Skip to content

Conversation

graalvmbot
Copy link
Collaborator

With this change, native-image supports running new main variants as proposed by JEP 445 as a preview feature of JDK 21. For example:

$ cat UnnamedHello.java
void main() {
    System.out.println("Hello, World!");
}

$ javac --enable-preview --source 21 UnnamedHello.java
Note: UnnamedHello.java uses preview features of Java SE 21.
Note: Recompile with -Xlint:preview for details.

$ native-image --enable-preview UnnamedHello
...
Finished generating 'unnamedhello' in 17.6s.

$ ./unnamedhello
Hello, World!

This change primarily deals with the "instance main methods" part of JEP 445. There is no full support for "unnamed classes" yet.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 20, 2023
@graalvmbot graalvmbot merged commit 8cb1c5d into master Jun 20, 2023
@graalvmbot graalvmbot deleted the je/svm-instance-main-method-GR-46507 branch June 20, 2023 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants