yWorks / yGuard

The open-source Java obfuscation tool working with Ant and Gradle by yWorks - the diagramming experts
https://yworks.github.io/yGuard/
MIT License
357 stars 59 forks source link

Java 22 Support #153

Open tugalsan opened 1 month ago

tugalsan commented 1 month ago

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

thomasbehr commented 1 month ago

We have not decided yet.

yGuy commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

@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 commented 1 month ago

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 commented 1 month ago

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