ndsev/zserio-service-rest-java

Which JDK Version? JDK1.8, JDK 11, or JDK 17+

Closed this issue · 1 comments

GdZ commented

In the readme.md file shows that the project requires JDK11+. But when I use JDK 17 with mvn package, then faced with error. When I use JDK 11, then it works fine.

> java -version
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode)
> mvn package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] calculator-parent                                                  [pom]
[INFO] calculator-service                                                 [jar]
[INFO] calculator-client                                                  [jar]
[INFO] calculator-server                                                  [jar]
[INFO]
[INFO] -------------< zserio.service.rest.java:calculator-parent >-------------
[INFO] Building calculator-parent 0.0.1-SNAPSHOT                          [1/4]
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] ------------< zserio.service.rest.java:calculator-service >-------------
[INFO] Building calculator-service 0.0.1-SNAPSHOT                         [2/4]
[INFO]   from calculator-service/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- exec:3.0.0:java (default) @ calculator-service ---
Parsing zserio-service-rest-java/calculator-service/../zserio/calculator.zs
Calling C++11 Generator extension check
Calling Doc Generator extension check
Calling Java Generator extension check
Calling Python Generator extension check
Calling XML Generator extension check
Extension C++11 Generator is disabled
Extension Doc Generator is disabled
Calling Java Generator extension
  Generated 4 files
Extension Python Generator is disabled
Extension XML Generator is disabled
Done
[INFO]
[INFO] --- build-helper:3.2.0:add-source (default) @ calculator-service ---
[INFO] Source directory: zserio-service-rest-java/calculator-service/target/zserio-gen added.
[INFO]
[INFO] --- resources:3.2.0:resources (default-resources) @ calculator-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory zserio-service-rest-java/calculator-service/src/main/resources
[INFO] skip non existing resourceDirectory zserio-service-rest-java/calculator-service/src/main/resources
[INFO]
[INFO] --- compiler:3.8.1:compile (default-compile) @ calculator-service ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 9 source files to zserio-service-rest-java/calculator-service/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for calculator-parent 0.0.1-SNAPSHOT:
[INFO]
[INFO] calculator-parent .................................. SUCCESS [  0.004 s]
[INFO] calculator-service ................................. FAILURE [  5.661 s]
[INFO] calculator-client .................................. SKIPPED
[INFO] calculator-server .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.442 s
[INFO] Finished at: 2023-11-07T00:25:38+01:00
[INFO] ------------------------------------------------------------------------
[WARNING]
[WARNING] Plugin validation issues were detected in 4 plugin(s)
[WARNING]
[WARNING]  * org.apache.maven.plugins:maven-resources-plugin:3.2.0
[WARNING]  * org.apache.maven.plugins:maven-compiler-plugin:3.8.1
[WARNING]  * org.codehaus.mojo:build-helper-maven-plugin:3.2.0
[WARNING]  * org.codehaus.mojo:exec-maven-plugin:3.0.0
[WARNING]
[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE]
[WARNING]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project calculator-service: Fatal error compiling: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0x64fdcf99) 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 @0x64fdcf99 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :calculator-service

Thanks for reporting this problem!

Actually, we directly support Java JDK 1.8 only and we rely that newer Java JDK versions will work as well.

In this case, it seems that we used old lombok library version which did not support JDK 1.17. We have just upgraded this library and it should work now for even JDK 1.17 as well.