JDK从1.7.x升到1.8.x后Eclipse Maven打包及Tomcat服务启动问题处理


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必须要重新安装服务。


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值