apache tomcat 9.x 不适用于 eclipse 和 Java 10.0.1
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50085750/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
apache tomcat 9.x not working with eclipse & Java 10.0.1
提问by Saurabh Bhoomkar
I've installed apache-tomcat-9.0.7on my windows machine and have following environment configurations:
我已经在我的 windows 机器上安装了 apache-tomcat- 9.0.7并具有以下环境配置:
echo %JAVA_HOME%
回声%JAVA_HOME%
C:\Program Files\Java\ jdk-10.0.1
C:\Program Files\Java\ jdk-10.0.1
echo %JRE_HOME%
回声 %JRE_HOME%
C:\Program Files\Java\ jre-10.0.1
C:\Program Files\Java\ jre-10.0.1
OS : Windows 8 64-bit
操作系统:Windows 8 64 位
Eclipse Version: Oxygen.3aRelease (4.7.3a)
Eclipse 版本:Oxygen.3a发布 (4.7.3a)
Whenever I run catlina.bat startfrom cmd, server runs fine on localhost But I'm not able to get the server instance up from eclipse's server configuration.
每当我catlina.bat start从cmd运行时,服务器在 localhost 上运行良好但我无法从 eclipse 的服务器配置中获取服务器实例。
- Defined a new server in eclipse and added apache-tomact 9.0 instance
Upon clicking on start server , I get the following error:
-Djava.endorsed.dirs=C:\Softwares\apache-tomcat-9.0.7\endorsed is not supported.
Endorsed standards and standalone APIs in modular form will be supported via the concept of upgradeable modules.
- 在eclipse中定义了一个新的服务器并添加了apache-tomact 9.0实例
单击 start server 后,出现以下错误:
-Djava.endorsed.dirs=C:\Softwares\apache-tomcat-9.0.7\endorsed 不受支持。
Endorsed standards and standalone APIs in modular form will be supported via the concept of upgradeable modules.
Any solution for this issue ?
这个问题有什么解决方案吗?
回答by nitind
You need an update that isn't on the main Oxygen site. Add http://download.eclipse.org/webtools/repository/oxygen/as a URL in your Available Software Sitespreference page and then check for updates from the Helpmenu.
您需要一个不在 Oxygen 主站点上的更新。http://download.eclipse.org/webtools/repository/oxygen/在“可用软件站点”首选项页面中添加为 URL,然后从“帮助”菜单检查更新。
https://bugs.eclipse.org/533162
https://bugs.eclipse.org/533162
Edit: this fix will be properly included in the Photon (WTP 3.10) release later this month.
编辑:此修复程序将正确包含在本月晚些时候的 Photon (WTP 3.10) 版本中。
回答by Nandakumar Purohit
In my Eclipse Oxygen IDE, WTP version did not update as suggested by @nitind.
在我的 Eclipse Oxygen IDE 中,WTP 版本没有按照 @nitind 的建议进行更新。
I figured out a fix with some trial and error as I wanted to change JRE version for Tomcat
由于我想更改 Tomcat 的 JRE 版本,因此我通过反复试验找到了解决方法
- To use Tomcat 8 with JRE 8 Eclispe --> Preferences --> Server --> Runtime Environments --> Select Tomcat 8 --> Edit --> Change default JRE to JRE 8
- 将 Tomcat 8 与 JRE 8 Eclispe 一起使用 --> 首选项 --> 服务器 --> 运行时环境 --> 选择 Tomcat 8 --> 编辑 --> 将默认 JRE 更改为 JRE 8
Also change JDK version in Compiler & Project Facets
还要在 Compiler & Project Facets 中更改 JDK 版本
- Eclispe --> Preferences --> Server --> Runtime Environments --> Select Tomcat 9 --> Edit --> Change default JRE to JRE 9
- Eclispe --> 首选项 --> 服务器 --> 运行时环境 --> 选择 Tomcat 9 --> 编辑 --> 将默认 JRE 更改为 JRE 9
Also change JDK version to 9 in Compiler & Project Facets
还要在 Compiler & Project Facets 中将 JDK 版本更改为 9
Also need to remove -Djava.endorsed argument from "Runtime Configurations" in Project right click --> Run As --> Run Configurations --> Apache Tomcat
还需要从项目中的“运行时配置”中删除 -Djava.endorsed 参数右键单击 --> 运行方式 --> 运行配置 --> Apache Tomcat
It will surely work! :)
它肯定会起作用!:)


