I am setting up a local instance to run a Java webapp. It’s been a while since I’ve done this but I’ve done it in the past. So far what I’ve done is installed JDK 22.0.2 and Netbeans 22 on my local machine. I’ve created a new Netbeans project Java with Maven Web Application. For my server I have Apache Tomcat 9 installed and I’m selecting Jakarta EE 8 Web for my Java EE version, I’m assuming that is the latest but here is a screenshot of all the available options.
After this I click finish and let the new project get created. Just to make sure everything works I run the project but I’m getting the following error.
BUILD FAILURE
Total time: 24.932 s
Finished at: 2024-07-26T11:26:49-04:00
Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:war (default-war) on project UnitConverter: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.3:war failed: Unable to load the mojo ‘war’ in the plugin ‘org.apache.maven.plugins:maven-war-plugin:2.3’ due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: null
realm = plugin>org.apache.maven.plugins:maven-war-plugin:2.3
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/Users/LauXi/.m2/repository/org/apache/maven/plugins/maven-war-plugin/2.3/maven-war-plugin-2.3.jar
urls1 = file:/C:/Users/LauXi/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar
urls[2] = file:/C:/Users/LauXi/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar
urls[3] = file:/C:/Users/LauXi/.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar
urls[4] = file:/C:/Users/LauXi/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
urls[5] = file:/C:/Users/LauXi/.m2/repository/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar
urls[6] = file:/C:/Users/LauXi/.m2/repository/org/codehaus/plexus/plexus-io/2.0.5/plexus-io-2.0.5.jar
urls[7] = file:/C:/Users/LauXi/.m2/repository/org/codehaus/plexus/plexus-archiver/2.2/plexus-archiver-2.2.jar
urls[8] = file:/C:/Users/LauXi/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.15/plexus-interpolation-1.15.jar
urls[9] = file:/C:/Users/LauXi/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
urls[10] = file:/C:/Users/LauXi/.m2/repository/com/thoughtworks/xstream/xstream/1.4.3/xstream-1.4.3.jar
urls[11] = file:/C:/Users/LauXi/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar
urls[12] = file:/C:/Users/LauXi/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar
urls[13] = file:/C:/Users/LauXi/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.jar
urls[14] = file:/C:/Users/LauXi/.m2/repository/org/apache/maven/shared/maven-filtering/1.0-beta-2/maven-filtering-1.0-beta-2.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]
: ExceptionInInitializerError: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not “opens java.util” to unnamed module @1dd64243
-> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
I’ve been reading a lot of posts and articles but nothing that seems to know why this would be occurring with a brand new project. Any ideas would be much appreciated.