【发布时间】:2016-08-18 12:12:13
【问题描述】:
当我在 Eclipse 中运行我的 Maven 构建时,我遇到了以下问题。我看到很多这样的帖子,但我仍然无法解决这个问题。我的可能更具体一点,我知道我的 JAVA_HOME 指向 java6,那是因为我正在开发另一个使用 java 6 的应用程序。我遇到问题的应用程序使用 Java 8
[ERROR] COMPILATION ERROR : [INFO] -------------------------------------------------------------
[ERROR] Unable to locate the Javac Compiler in: C:\Program Files\Java\jre1.8.0_92\..\lib\tools.jar Please ensure you are using JDK 1.4 or above and not a JRE (the com.sun.tools.javac.Main class is required). .In most cases you can change the location of your Java installation by setting the JAVA_HOME environment variable. [INFO] 1 error
<br>[INFO] -------------------------------------------------------------
<br>[INFO] ------------------------------------------------------------------------
<br>[INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------
<br>[INFO] Total time: 11:53 min [INFO] Finished at: 2016-08-18T16:52:13+05:30
<br>[INFO] Final Memory: 11M/141M
<br>[INFO] ------------------------------------------------------------------------
<br>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project
Compilation failure [ERROR] Unable to locate the Javac Compiler in: [ERROR] C:\Program Files\Java\jre1.8.0_92\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and [ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
<br>[ERROR] In most cases you can change the location of your Java [ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
如何在不安装 java 8 的情况下解决此问题,因为它可能会更改我的 JAVA_HOME 等,这会使我的其他应用程序无法运行。有没有办法在不运行 .exe 的情况下获取 JDK 文件夹(ps 我已经尝试过 7zip 方法) 请推荐
【问题讨论】:
-
你可以从其他电脑复制
-
你可以下载
.exe,解压,然后运行unpack200工具(自带)将.pack文件解压到.jar库中,就可以正常使用了很好。 -
@A_Di-Matteo,我该如何解压?
-
你能找到你的
pom.xml吗? -
不要下载
.exe对不起,下载tar.gz,它也适用于Windows,你只需用7zip解压即可