我在eclipse中運行我的maven版本時遇到了以下問題。我看到很多這樣的帖子,但我仍然無法解決這個問題。我可能會更具體一些,我知道我的JAVA_HOME指向java6,這是因爲我正在使用另一個使用java 6的應用程序。應用程序在我遇到問題,使用Java 8編譯錯誤JAVA的多版本
[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等這將使我的其他應用程序無法運行。有沒有辦法讓JDK文件夾不運行.exe(p.s我已經嘗試過7zip方法) 請建議
您可以從其他計算機上覆制它 – Jens
您可以下載'.exe',將它解壓縮,然後運行['unpack200'(http://docs.oracle.com/javase/7/docs/technotes/tools/share/unpack200.html)工具(與它一起)將'.pack'文件解壓縮到'.jar'庫中,然後它就可以正常工作。 –
@ A_Di-Matteo,我該如何解壓? – user3223509