Fail fast on JDK < 11 with a friendly error; document JDK 11-25 runtime support#4840
Merged
shai-almog merged 2 commits intomasterfrom May 1, 2026
Merged
Fail fast on JDK < 11 with a friendly error; document JDK 11-25 runtime support#4840shai-almog merged 2 commits intomasterfrom
shai-almog merged 2 commits intomasterfrom
Conversation
…d runtime The simulator and "Run as desktop app" goals fork the JVM with --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED and similar options, which JDK 8 rejects with "Could not create the Java Virtual Machine". The desktop run also surfaced as the opaque "An exception occured while executing the Java class ...Stub" from exec-maven-plugin. Add a runtime JDK check in JavaVersionUtil and call it from PrepareSimulatorClasspathMojo and GenerateDesktopAppWrapperMojo so the user gets a clear, actionable MojoFailureException naming the detected version, JAVA_HOME, and a pointer to Adoptium before anything is forked. Update README.md, BUILDING.md, CLAUDE.md, and the developer guide (Index.asciidoc, Maven-Getting-Started.adoc, Working-With-CodenameOne-Sources) to call out JDK 11 through 25 as the supported runtime range while keeping JDK 8 as the build-time requirement for the core framework. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
The previous commit gated generate-desktop-app-wrapper and prepare-simulator-classpath on JDK 11+, which broke the JDK 8 CI build: the executable-jar profile (used by build.sh jar / migrate-googlemapsdemo integration test) calls generate-desktop-app-wrapper to generate icons, and that mojo only emits PNGs and adjusts the source path -- it does not need JDK 11+. Likewise prepare-simulator-classpath runs in many build flows that legitimately work on JDK 8. Move the check to CN1RunMojo and CN1DebugMojo, which are the explicit "actually launch the simulator" entry points (mvn cn1:run / cn1:debug). Build-only goals stay unguarded. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
|
Compared 85 screenshots: 85 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Collaborator
|
Compared 85 screenshots: 85 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prepare-simulator-classpathandgenerate-desktop-app-wrapper, and abort with aMojoFailureExceptionthat names the detected version,JAVA_HOME, and a pointer to Adoptium — instead of the opaqueAn exception occured while executing the Java class ...Stub(desktop run) orUnrecognized option: --add-exports=...(simulator) the user currently sees.README.md,BUILDING.md,CLAUDE.md, and the developer guide (Index.asciidoc,Maven-Getting-Started.adoc,Working-With-CodenameOne-Sources.asciidoc) to call out JDK 11 through 25 as the supported runtime range, while keeping JDK 8 as the build-time requirement for the core framework.Why
The JavaSE port forks the JVM with
--add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED(and similar options). JDK 8 rejects these flags before the JVM even starts, and exec-maven-plugin'sjavagoal swallows the underlying cause for the desktop run. Failing fast in the plugin gives the user a clear next step instead of a stack trace.Test plan
mvn clean compileonmaven/codenameone-maven-pluginsucceeds (verified locally).prepare-simulator-classpathandgenerate-desktop-app-wrapperabort with the newCodename One supports JDK 11 through 25 …message and a non-zero exit before any forked JVM starts.🤖 Generated with Claude Code