eclipse org.apache.jasper.JasperException:PWC6345:调用 javac 时出错。需要完整的 JDK(不仅仅是 JRE)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17555894/
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
org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required
提问by uLYsseus
Before posting this question here: I looked up at
在在这里发布这个问题之前:我抬头看了看
1) IDEA 11.1.4 中的 Glassfish 3.1.2.2:“PWC6345:调用 javac 时出错。需要完整的 JDK(不仅仅是 JRE)”
2) How do I specify the jdk for a glassfish domain?
3) http://alvinalexander.com/blog/post/java/fixing-glassfish-jdk-path-problem-solved
3) http://alvinalexander.com/blog/post/java/fixing-glassfish-jdk-path-problem-solved
4) https://www.java.net//node/702274
4) https://www.java.net//node/702274
5)“PWC6345:调用javac时出错。” 使用 Jetty WTP 插件在 Jetty 上部署 JSP 页面时出错
I am able to open the glassfish admin window in eclipse, but when I am trying to run my project, I get this annoying error: "org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required"
我可以在 eclipse 中打开 glassfish 管理窗口,但是当我尝试运行我的项目时,出现了这个恼人的错误:“org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac. A full JDK (不仅仅是 JRE)是必需的”
I looked at the above listed posts, but werent useful in my case...I have my java environment set..
我查看了上面列出的帖子,但在我的情况下没有用...我设置了我的 java 环境..
But They Did not solve my problem. I still get the error as in the heading, there is already a question posted on a similar one, but doesnt have an answer I require....
但他们没有解决我的问题。我仍然收到标题中的错误,已经在类似问题上发布了一个问题,但没有我需要的答案....
回答by willome
That is probably the same problem encountered with the m2clipse plugin : You have to tell eclipse to use the JDK when launching Eclipse. Only setting the JDK/JRE on the Window>Preferences has no effect.
这可能与 m2clipse 插件遇到的问题相同:您必须在启动 Eclipse 时告诉 eclipse 使用 JDK。仅在 Window>Preferences 上设置 JDK/JRE 无效。
For example add this argument :
例如添加这个参数:
C:\eclipse\eclipse.exe -vm C:\Java\jdk1.6.0_20\bin\javaw
Or edit the eclipse.ini file to add the vm argument.
或者编辑 eclipse.ini 文件以添加 vm 参数。
There are plenty of possibilities. Check this link to get the right answer : m2eclipse: Eclipse is running in a JRE, but a JDK is required
有很多可能性。检查此链接以获得正确答案:m2eclipse: Eclipse is running in a JRE, but a JDK is required
回答by Lenymm
For those who can't find an answer here...
对于那些在这里找不到答案的人......
For me this problem occured when I kept re-deploying a project on Glassfish for a while and the server ran into PermGem. This message was displayed first and sometimes it doesn't even show up. Restarting the server allways helps.
对我来说,这个问题发生在我在 Glassfish 上重新部署一个项目一段时间后,服务器遇到了 PermGem。此消息首先显示,有时甚至不显示。重新启动服务器总是有帮助的。
回答by Narendra kumar C
Solution is simple,
解决方法很简单,
All you need to do below steps : Prerequisites : Make sure JAVA_HOME, JRE_HOME, Path must be set in environment variable (both locally and system variable) and verify the same in cmd
所有你需要做的步骤如下: 先决条件:确保 JAVA_HOME、JRE_HOME、Path 必须在环境变量(本地和系统变量)中设置,并在 cmd 中验证相同
- In Eclipse/STS/DeveloperStudio , Go to Windows -> Preferences -> Java -> Installed JREs
- Remove the old JRE_1.8.012 and add new i,e : Add -> Standard VM ->JRE Home : C:\Program Files\Java\jdk1.8.0_121 (give JDK path not JRE) -> JRE Name : jdk1.8.0_121 -> Finish
- Then Select, the listed JDK -> apply and close
- Go to Server(Tomcat) -> Runtime Environment ->verify selected runtime JREs it should be jdk1.8.0_121 (In my case)
- Restart Eclipse, restart server
- 在 Eclipse/STS/DeveloperStudio 中,转到 Windows -> Preferences -> Java -> Installed JREs
- 删除旧的 JRE_1.8.012 并添加新的 i,e : Add -> Standard VM ->JRE Home : C:\Program Files\Java\jdk1.8.0_121 (给 JDK 路径而不是 JRE) -> JRE Name : jdk1.8.0 _121 -> 完成
- 然后选择,列出的JDK->应用并关闭
- 转到服务器(Tomcat)-> 运行时环境-> 验证选定的运行时 JRE,它应该是 jdk1.8.0_121(在我的情况下)
- 重启Eclipse,重启服务器
回答by ThaSaleni
Had this issue, realized that the issue was actually with my glassfish instance and not eclipse when i deployed the same war to a remote glassfish server and it deployed fine. So i went to glassfish docs and searched how to change the jdk for your domain and this worked for me.
有这个问题,当我将相同的War部署到远程 glassfish 服务器并且部署正常时,意识到问题实际上是我的 glassfish 实例而不是 eclipse。所以我去了 glassfish 文档并搜索了如何为您的域更改 jdk,这对我有用。
asadmin set "server.java-config.java-home=path-to-java-home"
回答by user3923471
If you are like me trying to run the application in a standalone container, and not in Eclipse environment. You need to change the JVM general settings on glassfish through admin console, and restart glassfish
如果您像我一样尝试在独立容器中而不是在 Eclipse 环境中运行应用程序。您需要通过管理控制台更改 glassfish 上的 JVM 常规设置,然后重新启动 glassfish
回答by asifaftab87
I added this line to 'eclipse.ini' file which is present inside eclipse folder.
我将此行添加到 eclipse 文件夹中的“eclipse.ini”文件中。
-vm
-vm
C:\Program Files\Java\jdk1.8.0_131\bin\javaw.exe
C:\Program Files\Java\jdk1.8.0_131\bin\javaw.exe
and I also change the JRE path in eclipse
我也在 Eclipse 中更改了 JRE 路径
windows -> preferences -> java -> Installed JREs
windows -> 首选项 -> java -> 已安装的 JRE
and provided path upto jdk
并提供了 jdk 的路径
C:\Program Files\Java\jdk1.8.0_131
C:\Program Files\Java\jdk1.8.0_131
my issue resolved.
我的问题解决了。
Thanks
谢谢
回答by Pravesh Chapagain
I faced the same problem and resolved it.My eclipse was using jre not jdk.I just changed the jre. Go to Window->Preferences->Java->Installed JRE's. Remove the entry and add the path to your jdk's bin folder. After adding don't forget that your jdk is checked and then apply and close the windows.Now the program should run.
我遇到了同样的问题并解决了它。我的 eclipse 使用的是 jre 而不是 jdk。我只是更改了 jre。转到 Window->Preferences->Java->Installed JRE's。删除条目并将路径添加到 jdk 的 bin 文件夹。添加后不要忘记检查您的jdk,然后应用并关闭windows。现在程序应该运行了。
回答by Mwas
I had this same issue, this was due to the mistake that I had forgot to set JAVA_HOME to point to the correct Java installation path in my environment variables.
我遇到了同样的问题,这是由于我忘记将 JAVA_HOME 设置为指向环境变量中正确的 Java 安装路径的错误。
回答by Yuri Grigoriev
Try add vaiable AS_JAVA in ./glassfish/config to asenv.bat or/and asenv.conf
尝试将 ./glassfish/config 中的可变 AS_JAVA 添加到 asenv.bat 或/和 asenv.conf
回答by nitind
You need to run Glassfish using a JDK rather than a JRE. I'm not entirely sure what you mean by having your Java environment set, but it wouldn't apply here. Eclipse is running the Glassfish server you told it about using the Java Runtime you told to use.
您需要使用 JDK 而不是 JRE 来运行 Glassfish。我不完全确定设置 Java 环境是什么意思,但它不适用于这里。Eclipse 正在运行您告诉它有关使用您告诉使用的 Java 运行时的 Glassfish 服务器。