How to build JDK7 pom.xml using JDK 11?

I need to build this https://repo1.maven.org/maven2/org/glassfish/ha/ha-api/3.1.12/ from sources in JDK 11 environment (Maven 3.8.1) here is pom.xml https://repo1.maven.org/maven2/org/glassfish/ha/ha-api/3.1.12/ha-api-3.1.12.pom now I got the following error:

mvn install      
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin org.glassfish.hk2:hk2-maven-plugin:2.0.5
        or one of its dependencies could not be resolved:
        Could not find artifact com.sun:tools:jar:2.0.5 at specified path /home/katya/java/../lib/tools.jar @ 
[ERROR] Unknown packaging: hk2-jar @ line 32, column 16
[WARNING] 'build.plugins.plugin[org.glassfish.hk2:hk2-maven-plugin].dependencies.dependency.systemPath'
          for com.sun:tools:jar refers to a non-existing file /home/katya/java/../lib/tools.jar.
          Please verify that you run Maven using a JDK and not just a JRE. @ line 161, column 37

Please tell me how to modify pom.xml to build in my environment? Thank you!

Upvotes: 0

Views: 209

Answers (1)

Gerold Broser
Gerold Broser

Reputation: 14762

Could not find artifact com.sun:tools:jar:2.0.5 at specified path /home/katya/java/../lib/tools.jar`

and

com.sun:tools:jar refers to a non-existing file /home/katya/java/../lib/tools.jar.
Please verify that you run Maven using a JDK and not just a JRE.

give valuable hints.

There is no .../lib/tools.jar in a JRE and there's also no .../lib/tools.jar in JDK 9 onwards.

Upvotes: 3

Related Questions