domino-ui icon indicating copy to clipboard operation
domino-ui copied to clipboard

mvn clean install - issue with JDK version

Open jimbok8 opened this issue 2 years ago • 10 comments

I am following these instructions: Create a Domino-ui Project Method 1: Create project using dominokit-cli tool:

  • Your are done, CD into the project folder, execute mvn clean install and follow the readme file to run the application.

I am using Azul zulu JDK versions. When I set JAVA_HOME to version JDK 8, I get the following error message: Caused by: java.lang.UnsupportedClassVersionError: io/quarkus/maven/components/BootstrapSessionListener has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I am just getting started with GWT and have found out that JDK 8 was need for apache maven plugin stuff.

If I change JAVA_HOME to JDK 17, I get the following error message: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.2:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.2' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Cannot access defaults field of Properties

Please help? Which JDK should I be using? Or am I missing something else? Jim

jimbok8 avatar Feb 20 '22 16:02 jimbok8

Can you please share the following information :

  • The command you used to the create the project.
  • The exact java version/name: the result of java -version from the terminal where you are building the project

and finally it is recommended to use java 11.

vegegoku avatar Feb 21 '22 12:02 vegegoku

Test 1 - JDK 8

  • The command you used to the create the project: dominokit gen app -n TrackMap -t basic -g com.design57 The output: Feb 22, 2022 9:21:34 PM org.dominokit.cli.commands.GenerateAppCommand run INFO: No parent pom was found, creating a root project. The following project have been created Project { name='TrackMap' groupId='com.design57' artifactId='TrackMap' version='1.0-SNAPSHOT' compiler='null' rootPackage='com.design57' moduleShortName='TrackMap' hasParent=false parentArtifactId='' generateApi=true }

  • The result of java -version: openjdk version "1.8.0_322" OpenJDK Runtime Environment (Zulu 8.60.0.21-CA-win64) (build 1.8.0_322-b06) OpenJDK 64-Bit Server VM (Zulu 8.60.0.21-CA-win64) (build 25.322-b06, mixed mode)

  • The error from mvn clean install:

[WARNING] Error injecting: io.quarkus.maven.components.BootstrapSessionListener java.lang.TypeNotPresentException: Type io.quarkus.maven.components.BootstrapSessionListener not present

Caused by: java.lang.UnsupportedClassVersionError: io/quarkus/maven/components/BootstrapSessionListener has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

jimbok8 avatar Feb 22 '22 21:02 jimbok8

I will try to reproduce this ASAP.

vegegoku avatar Feb 22 '22 21:02 vegegoku

Test 2 - JDK 17

  • The command you used to the create the project: dominokit gen app -n TrackMap -t basic -g com.design57

  • The result of java -version: openjdk version "17.0.2" 2022-01-18 LTS OpenJDK Runtime Environment Zulu17.32+13-CA (build 17.0.2+8-LTS) OpenJDK 64-Bit Server VM Zulu17.32+13-CA (build 17.0.2+8-LTS, mixed mode, sharing)

  • The error from mvn clean install: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project TrackMap-server: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.2:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.2' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Cannot access defaults field of Properties [ERROR] ----------------------------------------------------- [ERROR] realm = plugin>org.apache.maven.plugins:maven-war-plugin:2.2 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy

jimbok8 avatar Feb 22 '22 21:02 jimbok8

Test 3 - JDK 11

  • The result of java -version: openjdk version "11.0.14.1" 2022-02-08 LTS OpenJDK Runtime Environment Zulu11.54+25-CA (build 11.0.14.1+1-LTS) OpenJDK 64-Bit Server VM Zulu11.54+25-CA (build 11.0.14.1+1-LTS, mixed mode)

SUCCESS!!!

  • mvn clean install: [INFO] Reactor Summary for TrackMap 1.0-SNAPSHOT: [INFO] [INFO] TrackMap ........................................... SUCCESS [ 0.435 s] [INFO] TrackMap-shared .................................... SUCCESS [ 1.756 s] [INFO] TrackMap-client .................................... SUCCESS [01:05 min] [INFO] TrackMap-server .................................... SUCCESS [ 3.774 s] [INFO] TrackMap-api ....................................... SUCCESS [ 40.667 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:54 min [INFO] Finished at: 2022-02-22T21:47:09Z [INFO] ------------------------------------------------------------------------

jimbok8 avatar Feb 22 '22 21:02 jimbok8

Java 11 is the max that we can support because GWT itself does not support any higher version, java 8 should work ..but maybe we nees to change the source level and target in the poms.

vegegoku avatar Feb 22 '22 21:02 vegegoku

I do not think, that the problem is related to Domino-UI.

Caused by: java.lang.UnsupportedClassVersionError: io/quarkus/maven/components/BootstrapSessionListener has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

is telling you that the lib containing the BootstrapSessionListener was build with Java 11 and can not be used with Java 8.

GWT works well with Java 17. (Just running a GWT-application using Domino-UI with Java 17)

The second bug sounds like the war plugin version can not be used with Java 17. Add the war plugin/update to your pom and use the latest version and try again.

FrankHossfeld avatar Jun 23 '22 18:06 FrankHossfeld

A few small corrections:

  • GWT will run just fine on Java 17, it just can't handle java 12-17 sources.
  • org.codehaus.plexus.component.repository.exception.ComponentLookupException: Cannot access defaults field of Properties - this is a bug in the current war plugin - if you want to use Java 17, you have to update that plugin (j2cl-maven-plugin has the same issue with its archetypes at this time)

niloc132 avatar Jun 23 '22 23:06 niloc132

as for the java 8 the problem here is that the CLI will generate a module for the rest api that is based on quarkus and quarkus no longer supports java 8 https://github.com/quarkusio/quarkus/wiki/Why-Dropping-Java-8

vegegoku avatar Jun 25 '22 15:06 vegegoku

for java 17 I tested with 17.0.1-open and it builds without errors

vegegoku avatar Jun 25 '22 17:06 vegegoku

and Domino-UI also no longer supports Java 8. So the issue can be closed.

FrankHossfeld avatar Nov 26 '23 10:11 FrankHossfeld