process-analytics / bpmn-layout-generators

Tools for generating missing BPMNDiagram elements in BPMN files
Apache License 2.0
34 stars 4 forks source link

[BUG] Incompatibility with OpenJDK 21: NoSuchMethodException for sun.misc.Unsafe.defineClass #113

Open vmicka opened 1 month ago

vmicka commented 1 month ago

Describe the bug When running the bpmn layout generator with OpenJDK 21, a NoSuchMethodException occurs due to the absence of the sun.misc.Unsafe.defineClass method, causing a failure in JAXB context initialization.

To Reproduce 1- Use OpenJDK 21 2- sh java -jar lib/bpmn-layout-generator-0.1.4-jar-with-dependencies.jar --output=src/diagrams/diagram-with-layout.bpmn src/diagrams/diagram.bpmn

Expected behavior The command should execute without throwing an exception, generating the BPMN diagram, as it does with OpenJDK 11

Desktop

tbouffard commented 1 month ago

Hi JDK 17 and 21 are not tested nor guarantee to work https://github.com/process-analytics/bpmn-layout-generators/blob/bpmn-layout-generator-0.1.4/java/README.md

Requirements JDK 8 or JDK 11

In the GH Actions workflow, we only run with JDK 8 and 11 and there is a comment mentioning a build error with JDK 17 (https://github.com/process-analytics/bpmn-layout-generators/blob/118ded76772377b0d9cef03a7bc40a938344b55d/.github/workflows/build-java.yml)

# java 17 fails: Fatal error compiling: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0x2fcad999) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @0x2fcad999

So what you mention here is that this project support run on JDK 21.