Eclipse, AppEngine: java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE

别说谁变了你拦得住时间么 提交于 2019-12-03 11:05:06

Go to Eclipse folder where you have eclipse installed (say c:\eclipse). You will find eclipse.ini file which eclipse uses to while starting. Add the following line -vm C:\Program Files\Java\jdk1.7.0_25\bin\javaw.exe

change the above java path with your location of JDK. It should be able to use this JDK and will compile and deploy to app engine.

In my case I was trying to File>Restart the Eclipse but not working when exited and run again It works

WOW!!! I was dealing with this issue for like 3-4 hours. Was just about to comment saying fuck this. But then I changed the eclipse.ini to:

-vm
A:/Programming/Java/jdk1.8.0_73/bin/javaw.exe

instead of:

-vm
A:/Programming/Java/jdk1.7.0_79/bin/javaw.exe

AND SUCCESS!

Why this might have worked? Not really sure. I needed 1.7 not 1.8... but 1.7 kept pointing to a JRE instead of the JDK... And surprisingly 1.8 didn't do that + still worked with the current build. Also worth mentioning to specify 1.7 in facets /build path & compiler..

I see that the OP is using Google Plugin for Eclipse (GPE), which is deprecated, but this was once also a problem in Cloud Tools for Eclipse (CT4E), so I'll leave a relevant answer for CT4E here for reference.

It was indeed a bug of Cloud Tools for Eclipse that it did not use the JDK configured for a project but instead used the JDK used to launch Eclipse for staging. The bug has been fixed: https://github.com/GoogleCloudPlatform/google-cloud-eclipse/issues/2195.

So, others answers in this question to edit eclipse.ini to change the JDK to launch Eclipse are a temporary workaround that is no longer needed. Just update to the latest CT4E version and set a JDK for a project. You can specify whatever JDK/JRE necessary in eclipse.ini for launching Eclipse.

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