Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 22 Support #153

Open
tugalsan opened this issue May 7, 2024 · 6 comments
Open

Java 22 Support #153

tugalsan opened this issue May 7, 2024 · 6 comments

Comments

@tugalsan
Copy link

tugalsan commented May 7, 2024

Will there be incremental support, like Java 22; or will wait for LTS, like Java 25?

@thomasbehr
Copy link
Member

We have not decided yet.

@yGuy
Copy link
Member

yGuy commented May 7, 2024

For some releases Oracle decided to massively change the bytecode and thus supporting the new versions was a lot of effort. Then again for other releases the bytecode doesn't change at all and supporting the new version is mostly a one-line change.

Someone will need to take a look at the bytecode changes so that we can estimate the time it requires to update yGuard accordingly. It all depends...

@Fohlen
Copy link
Member

Fohlen commented May 9, 2024

Since Java 21 is the LTS release of Java for the foreseeable future (7 years), Java 22 support is not high on the priority list. However @tugalsan you can always kickstart this process. The first step is to research the Java bytecode instruction set. You can diff Java 21 and 21 from here. Once you have a list of new bytecode instructions compiled, we can decide which ones need adjustments. If there are no breaking changes, we can get this rolling quickly. Would you be willing to collect such a list for us? 😉

@tugalsan
Copy link
Author

tugalsan commented May 10, 2024

@Fohlen Did i understand correctly? As a first step, https://docs.oracle.com/javase/specs/jvms/seXXX/html/index.html site needs to be compared.

I created a HelloWorld project with Java22 and it worked https://github.com/tugalsan/com.tugalsan.tst.yguard . I am so confused.

Which version X should be compared against 22? What is the latest supported Java of YGuard?

@thomasbehr
Copy link
Member

yGuard supports Java 21.

I think Fohlen meant to suggest comparing the Java 21 Virtual Machine Specification to the Java 22 Virtual Machine Specification.

Your HelloWorld project probably works, because your source code is essentially Java 8. I am not completely sure, but I think the Java compiler will actually not emit Java 22 byte code for such simple cases but emit Java 8 byte code. You probably need to add Java 22 language features for force the compiler to emit Java 22 byte code. (You can use javap to check the class file versions of the emitted byte code.)

@tugalsan
Copy link
Author

Yea, pom has a problem, it was 21 eventually, my bad.

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

No branches or pull requests

4 participants