Java 码头:错误 500 需要完整的 JDK(不仅仅是 JRE)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24673733/
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
jetty: error 500 A full JDK (not just JRE) is required
提问by Morgenstern
I really need help.
我真的需要帮助。
I'm trying to run my jsp aplication on new machine and jetty gives me this error: org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required
我正在尝试在新机器上运行我的 jsp 应用程序,但码头给了我这个错误:org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac。需要完整的 JDK(不仅仅是 JRE)
I'm using ecplipse kepler, maven and win8.1 x64.
我正在使用 ecplipse kepler、maven 和 win8.1 x64。
I know there was a lot of these questions but I'va tried everything: -reinstall jdk and jre; -add a java directory in eclipse.ini by -vm -home path is workin - I can call java from command line
我知道有很多这样的问题,但我已经尝试了一切:-重新安装 jdk 和 jre;- 通过 -vm 在 eclipse.ini 中添加一个 java 目录 -home path is workin - 我可以从命令行调用 java
all of these not fix my problem...
所有这些都不能解决我的问题......
EDIT: problem solved - it was eclipse luna bug - in eclipse kepler it is working
编辑:问题已解决 - 这是 eclipse luna 错误 - 在 eclipse kepler 中它正在工作
回答by Janoz
Jetty needs a JDK to compile the JSP files, not just a JRE. Your JAVA_HOME enviroment variable (or the one in the Jetty config) is probably pointing to the JRE instead of the JDK version.
Jetty 需要一个 JDK 来编译 JSP 文件,而不仅仅是一个 JRE。您的 JAVA_HOME 环境变量(或 Jetty 配置中的那个)可能指向 JRE 而不是 JDK 版本。
回答by Chhorn Elit
for my case only ... i don't know if it really answer your question
仅针对我的情况......我不知道它是否真的回答了你的问题
make sure that invoking java
is from JDK path C:\Program Files\Java\jdk1.x.x_xx\bin
确保调用java
来自 JDK 路径C:\Program Files\Java\jdk1.x.x_xx\bin
i just reinstall new JDK. JDK installation put java.exe
in the path C:\WINDOWS\system32\
我只是重新安装了新的JDK。JDK安装放在java.exe
路径中C:\WINDOWS\system32\
even if i config PATH variable correctly i will still be invoking from C:\WINDOWS\system32\
即使我正确配置了 PATH 变量,我仍然会从中调用 C:\WINDOWS\system32\
because it overrides calling from C:\Program Files\Java\jdk1.x.x_xx\bin\
因为它覆盖了来自 C:\Program Files\Java\jdk1.x.x_xx\bin\
so i will get that same error if i run
所以如果我运行,我会得到同样的错误
java -cp jetty-runner-9.2.13.v20150730.jar org.eclipse.jetty.runner.Runner xxx.war
i know it might sounds stupid but my solution is to delete C:\WINDOWS\system32\java.exe
我知道这听起来很愚蠢,但我的解决方案是删除 C:\WINDOWS\system32\java.exe
read more here “system32\java.exe” and “Program Files\Java\jdk1.6.0_33\bin\java.exe”
在这里阅读更多“system32\java.exe”和“Program Files\Java\jdk1.6.0_33\bin\java.exe”
回答by karthik
Try editing:
尝试编辑:
jetty.xml in C:\Program Files\jetty-distribution-9.2.19.v20160908\etc
C:\Program Files\jetty-distribution-9.2.19.v20160908\etc 中的jetty.xml
Add:
添加:
<call class="java.lang.System" name="setProperty">
<arg>org.apache.jasper.compiler.disablejsr199</arg>
<arg>true</arg>
</call>
under "configure" element
在“配置”元素下