Skip to content

Commit c3965e1

Browse files
claude: Warn instead of error for unsupported Java versions in veraPDF
Allow installation with any Java 8+. Warn (but proceed) for non-LTS versions or LTS versions newer than this veraPDF release supports. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 546dd97 commit c3965e1

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

src/tools/impl/verapdf.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ const kDefaultVersion = "1.28.2";
2929
// Minimum Java version required
3030
const kMinJavaVersion = 8;
3131

32+
// Highest Java LTS version officially supported by this veraPDF version.
33+
// Update this when bumping kDefaultVersion to a release that supports a newer LTS.
34+
const kMaxSupportedLtsVersion = 21;
35+
3236
// The name of the file that we use to store the installed version
3337
const kVersionFileName = "version";
3438

@@ -52,11 +56,20 @@ export const verapdfInstallable: InstallableTool = {
5256
return false;
5357
}
5458

55-
// Warn but allow installation for non-LTS Java versions
59+
// Warn but allow installation for non-LTS or too-new LTS Java versions
5660
if (!isLtsJavaVersion(javaVersion)) {
61+
const supportedVersions = Array.from(
62+
{ length: kMaxSupportedLtsVersion - 8 + 1 },
63+
(_, i) => i + 8,
64+
).filter(isLtsJavaVersion).join(", ");
5765
warning(
5866
`Java ${javaVersion} is not a Long-Term Support (LTS) version. ` +
59-
`veraPDF officially supports LTS versions (8, 11, 17, 21, 25, ...). ` +
67+
`veraPDF ${kDefaultVersion} officially supports Java ${supportedVersions}. ` +
68+
`Installation will proceed, but you may encounter issues.`,
69+
);
70+
} else if (javaVersion > kMaxSupportedLtsVersion) {
71+
warning(
72+
`Java ${javaVersion} is newer than veraPDF ${kDefaultVersion} officially supports. ` +
6073
`Installation will proceed, but you may encounter issues.`,
6174
);
6275
}

0 commit comments

Comments
 (0)