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
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.

2 participants