I have linked a JDK 1.8 which has tools.jar
. I am using Eclipse, the project is compiled with Java 1.8 and Maven 3.3.9, but I am getting the following error:
.apache.maven.plugin.MojoExecutionException: You need to run the build with JDK or have tools.jar on the classpath.If this occurs during eclipse build, make sure you run Eclipse under JDK as well
I have the Java and Maven environment variables set up. It is set up in Preference > Java > Installed JREs with the JDK 1.8 installation
.
The pom.xml
where the error is occurring has the following build:
<build>
<plugins>
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
I have this option checked in Maven > Java Configurator
If there is any further information that I need to provide or check, please let me know.
Add tools.jar
to reference the library
I have linked a JDK 1.8 which has tools.jar
. I am using Eclipse, the project is compiled with Java 1.8 and Maven 3.3.9, but I am getting the following error:
.apache.maven.plugin.MojoExecutionException: You need to run the build with JDK or have tools.jar on the classpath.If this occurs during eclipse build, make sure you run Eclipse under JDK as well
I have the Java and Maven environment variables set up. It is set up in Preference > Java > Installed JREs with the JDK 1.8 installation
.
The pom.xml
where the error is occurring has the following build:
<build>
<plugins>
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
I have this option checked in Maven > Java Configurator
If there is any further information that I need to provide or check, please let me know.
Add tools.jar
to reference the library
1 Answer
Reset to default 0Maven uses the JDK/JRE that it finds at JAVA_HOME not via the Eclipse >> Installed JREs.
You need to set the JAVA_HOME environment variable to a JDK not a JRE eg
JAVA_HOME=C:\Program Files\Java\jdk-17
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744366712a4570739.html
评论列表(0条)