JDK從1.7.x升到1.8.x後Eclipse Maven打包及Tomcat服務啟動問題處理__java

來源:互聯網
上載者:User


1      Eclipse JDK從1.7.x升級到1.8.xMaven打包問題解決

[INFO] 1 error

[INFO]-------------------------------------------------------------

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO]------------------------------------------------------------------------

[INFO] Total time: 1.552s

[INFO] Finished at: Wed Apr 2610:17:28 CST 2017

[INFO] Final Memory: 10M/112M

[INFO]------------------------------------------------------------------------

[ERROR] Failed to execute goalorg.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile)on project fmcgwms: Compilation failure

[ERROR] Unable to locate the JavacCompiler in:

[ERROR] C:\ProgramFiles\Java\jre1.8.0_92\..\lib\tools.jar

[ERROR] Please ensure you are usingJDK 1.4 or above and

[ERROR] not a JRE (thecom.sun.tools.javac.Main class is required).

[ERROR] In most cases you can changethe location of your Java

[ERROR] installation by setting theJAVA_HOME environment variable.

[ERROR] -> [Help 1]

[ERROR]

[ERROR] To see the full stack traceof the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -Xswitch to enable full debug logging.

[ERROR]

[ERROR] For more information aboutthe errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

  1.1  修改Eclipse JRE


1.2  添加JAVA_HOME\lib\tools.jar

選擇1.8版本的JRE:


選中行進行編輯添加:

  1.3  Eclipse Maven 打包設定

選擇打包項目:

 

設定JRE:

1.4  遷移到生產及測試環境必須重新設定JAVA_HOME

升級部署環境的JDK版本為1.8.x並設定相應的JAVA_HOME等環境變數。 2      Windows JDK升級Tomcat服務問題處理

在JDK1.7.x安裝的服務預設使用的是之前的JDK版本,需要卸載並重新安裝. 2.1  卸載Tomcat服務

cd 進入TOMCAT_HOME\bin目錄輸入:

 

TOMCAT_HOME\bin\service unstall TOMCAT-SERVER-NAME 2.2  安裝Tomcat服務

cd 進入TOMCAT_HOME\bin目錄輸入:

 

TOMCAT_HOME\bin\service install TOMCAT-SERVER-NAME

 

由此可見Tomcat服務安裝時是找到了JAVA_HOME環境變數來進行配置的,所以JDK升級後應用程式如果依賴JDK8必須要重新安裝服務。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.