Skip to content

Conversation

@cderv
Copy link
Collaborator

@cderv cderv commented Feb 11, 2026

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.message support async functions in addition to static strings. The veraPDF prereq now:

  • Detects the installed Java version
  • Reports "Java is not installed" if Java is missing
  • Reports "Java X is installed but not supported" with the actual version number
  • Dynamically builds the supported versions list from kSupportedJavaVersions

Results

Now I got

❯ quarto install verapdf
Installing verapdf
Java 25 is installed but not supported. veraPDF requires Java 8, 11, 17, 21.

However, there is still the question of why 25 is not supported, because manually I can install verapdf

@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Feb 11, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv cderv requested a review from gordonwoodhull February 11, 2026 10:15
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>
@cderv cderv added this to the v1.9 milestone Feb 11, 2026
@gordonwoodhull gordonwoodhull self-assigned this Feb 11, 2026
@gordonwoodhull
Copy link
Contributor

gordonwoodhull commented Feb 11, 2026

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.

@cderv
Copy link
Collaborator Author

cderv commented Feb 12, 2026

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.

@gordonwoodhull
Copy link
Contributor

gordonwoodhull commented Feb 12, 2026

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 Dockerfile as a copyable code block, unless it merits its own repo or gist).

IMO it should be a verapdf.qmd page and not a directory... I reckon we won't have too much more to say about veraPDF. If we need more advanced docs in this area it will probably be specific hints and tips around passing PDF accessibility checks, not really about veraPDF itself.

gordonwoodhull and others added 2 commits February 12, 2026 17:06
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>
@gordonwoodhull
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants