jetty: error 500 A full JDK (not just JRE) is required

眉间皱痕 提交于 2020-01-06 05:00:09

问题


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

I'm using ecplipse kepler, maven and 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

all of these not fix my problem...

EDIT: problem solved - it was eclipse luna bug - in eclipse kepler it is working


回答1:


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.




回答2:


Try editing:

jetty.xml in C:\Program Files\jetty-distribution-9.2.19.v20160908\etc

Add:

<call class="java.lang.System" name="setProperty">
    <arg>org.apache.jasper.compiler.disablejsr199</arg>
    <arg>true</arg>
</call>

under "configure" element




回答3:


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

i just reinstall new JDK. JDK installation put java.exe in the path C:\WINDOWS\system32\

even if i config PATH variable correctly i will still be invoking from C:\WINDOWS\system32\

because it overrides calling from 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

read more here “system32\java.exe” and “Program Files\Java\jdk1.6.0_33\bin\java.exe”




回答4:


properties->Libraries->JRE System Library->Edit->Installed JREs->Edit->JRE home



来源:https://stackoverflow.com/questions/24673733/jetty-error-500-a-full-jdk-not-just-jre-is-required

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!