-
Notifications
You must be signed in to change notification settings - Fork 409
Improve veraPDF Java version error message #14019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
The check and message functions were both calling getJavaVersion(), spawning the subprocess twice. This created inefficiency and a TOCTOU risk where the Java environment could change between calls. Now check caches the detected version in context.props.javaVersion, and message reads from the cache. The message function is now synchronous since it only reads from context. The InstallPreReq.message type was updated to allow both sync and async functions for flexibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
This is good; I’ll test and improve before merging tomorrow. As discussed, using a non-LTS version should probably be a warning, not an error. Etc. |
Yes that would solve the main issue that I had Java but couldn't install. And by the way, I managed to make a script wrapper to run vera through docker. So no need to install JAVA, which is helpful ! Not sure where I should document that. |
Nice! It's kind of a catch-all but I'd start a page under Advanced Docs on veraPDF and put the configuration there (with the IMO it should be a |
Allow veraPDF installation with any Java 8+, but warn if using a non-LTS version. LTS versions (8, 11, 17, 21, 25, ...) proceed silently. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
|
I've changed non-LTS versions to a warning and also handled the case where Java 25 is LTS but it was released after the current veraPDF, so it needs a different warning. |
When installing veraPDF with an unsupported Java version, the error message was generic: "Java is not installed or version is not supported. veraPDF requires Java 8, 11, 17, or 21."
This made it unclear whether Java was missing or just the wrong version.
Root Cause
The prereq check's error message was a static string, so it couldn't report the detected Java version.
Fix
Made
InstallPreReq.messagesupport async functions in addition to static strings. The veraPDF prereq now:kSupportedJavaVersionsResults
Now I got
However, there is still the question of why 25 is not supported, because manually I can install verapdf