jesterj icon indicating copy to clipboard operation
jesterj copied to clipboard

Java 17 support

Open nsoft opened this issue 1 year ago • 3 comments

We do not currently support Java 17, but support should be added. This may be somewhat difficult however, Here's what one gets with

openjdk 17.0.6 2023-01-17 LTS
OpenJDK Runtime Environment Zulu17.40+19-CA (build 17.0.6+10-LTS)
OpenJDK 64-Bit Server VM Zulu17.40+19-CA (build 17.0.6+10-LTS, mixed mode, sharing)

gives

CRASH and BURNED before starting main thread:
java.lang.NoSuchFieldException: scl
        at java.base/java.lang.Class.getDeclaredField(Class.java:2610)
        at org.jesterj.ingest.Main.initClassloader(Main.java:363)
        at org.jesterj.ingest.Main.main(Main.java:96)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at com.needhamsoftware.unojar.Boot.main(Boot.java:233)

To get class loading doing what we want we've been futzing with the system classloader, new code will be necessary since this has either moved, or become inaccessible (I suspect the later).

nsoft avatar Mar 29 '23 19:03 nsoft

There is a small chance that the move should be enhancements to uno-jar instead of JesterJ...

nsoft avatar Mar 29 '23 20:03 nsoft

This is running afoul of changes made during JEP-371 https://github.com/openjdk/jdk/commit/7cc137105928ec109a29d9315565f7f49af3cf2b

nsoft avatar Mar 30 '23 15:03 nsoft

This irritates me from time to time but I haven't had time to explore solutions. Today I had the thought that if I can add a "relaunch with props" feature to UnoJar to make it re-invoke itself with system properties derived from some convention (manifest, or included file) set by uno-jar then -Dsystem.class.loader=org.jesterj.JesterJLoader could be set. That would probably be a nice feature for UnoJar anyway, though it may be difficult to make that work reliably on all OS's

nsoft avatar Feb 27 '24 16:02 nsoft