QueryDSL-maven-您需要使用JDK运行构建或在类路径上具有tools.jar [英] QueryDSL-maven-You need to run build with JDK or have tools.jar on the classpath

查看:126
本文介绍了QueryDSL-maven-您需要使用JDK运行构建或在类路径上具有tools.jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有类似的问题,例如这样,我已经尝试了两种解决方案,但是没有一种对我有用.

I have same question like this,and I have tried the two solutions,but none works for me.

我从 github 页面复制了querydsl的配置.

I copied the configuration for querydsl from it's github page .

所以我的querydsl maven依赖项:

So my querydsl maven dependency:

    <dependency>
        <groupId>com.querydsl</groupId>
        <artifactId>querydsl-jpa</artifactId>
        <version>4.1.4</version>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.6.1</version>
    </dependency>

我的apt配置:

        <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>4.1.4</version>
                </dependency>
            </dependencies>
      </plugin>

我还修改了eclipse.ini,在第一行添加以下内容:

I also modified eclipse.ini,add follow at first line:

-vm
D:\Program Files\Java\jdk1.8.0_91\bin\javaw.exe

但是直到月食我都遇到了同样的错误:

But I till get the same error in eclipse:

You need to run build with JDK or have tools.jar on the classpath.If this occures during eclipse build make sure you run eclipse under JDK as well (com.mysema.maven:apt-maven-plugin:1.1.3:process:default:generate-sources)

当我在cmd中运行mvn genarate-sources时,会发生相同的错误:

And when I run mvn genarate-sources in cmd,same error occurs:

[INFO] --- apt-maven-plugin:1.1.3:process (default) 
[ERROR] execute error
org.apache.maven.plugin.MojoExecutionException: You need to run build with JDK or have tools.jar on the classpath.If this occures during eclipse build make sure you run eclipse under JDK as well

有人可以帮助我吗?

推荐答案

对于STS,请在eclipse.iniSTS.ini中包括以下行,

Please include the following line in your eclipse.ini or STS.ini in case of STS,

-vm {path_to_jdk}\jdk{your_version}\bin\javaw.exe

-vm {path_to_jdk}\jdk{your_version}\bin\javaw.exe

有关更多信息,问题

这篇关于QueryDSL-maven-您需要使用JDK运行构建或在类路径上具有tools.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆