Skip to content

Add experimental Java 17 option to Initializr#4600

Merged
shai-almog merged 3 commits intomasterfrom
codex/add-java-17-option-in-initializr
Mar 9, 2026
Merged

Add experimental Java 17 option to Initializr#4600
shai-almog merged 3 commits intomasterfrom
codex/add-java-17-option-in-initializr

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • The hellocodenameone example and related Maven build files were updated to Java 17, so the Initializr should offer a Java 17 project option while keeping the stable default unchanged.
  • Java 17 support is not yet fully vetted, so the option must be clearly labeled experimental and disabled by default.

Description

  • Added a ProjectOptions.JavaVersion enum with JAVA_8 and JAVA_17_EXPERIMENTAL, defaulting to JAVA_8, and carried the selection through ProjectOptions. (ProjectOptions.java)
  • Exposed a new “Java Version” panel in the Initializr UI and wired the selection into generation and the settings summary; the default remains Java 8. (Initializr.java)
  • Updated generation logic in GeneratorModel to apply Java-17-specific changes when JAVA_17_EXPERIMENTAL is selected: it sets codename1.arg.java.version=17 in common/codenameone_settings.properties and rewrites common/pom.xml compiler <source>/<target> from 1.8 to 17. (GeneratorModel.java)
  • Extended GeneratorModelMatrixTest to add a validateExperimentalJava17Generation check and updated helper assertions to verify both default Java 8 outputs and the experimental Java 17 outputs. (GeneratorModelMatrixTest.java)

Testing

  • Ran the Initializr module tests via Maven: cd scripts/initializr && mvn -pl common test -DskipTests=false, which failed due to a missing reactor artifact when building the module in isolation (initializr-ZipSupport not found). (failure)
  • Tried the multi-module build: cd scripts/initializr && mvn -pl common -am test -DskipTests=false, which progressed but failed in this environment during the install-codenameone step with java.net.SocketException: Network is unreachable while attempting to download UpdateCodenameOne.jar; test execution could not complete here. (blocked by network/environment)
  • Unit test coverage was updated: GeneratorModelMatrixTest now validates the experimental Java 17 generation behavior, but CI/local run is required to confirm green test results due to the environment limitations above.

Codex Task

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Cloudflare Preview

@shai-almog shai-almog merged commit 03680ec into master Mar 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant