33
votes

this is hopefully something simple but... Eclipse has been working relatively fine for everything except deploying to GAE.

I can run my GAE app locally, but when I try to deploy to google, I get this message:

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

I have set the build path to JDK.

It also happens when trying to deploy the same project from more than one system (win7 and win8) so I suspect the problem is to do with the project itself. This particular project is existing and already running on google for years.

Interesting that this error only shows up when I have .jsp files in my app to deploy. If I remove the jsp files, it deploys without error. (kinda need the jsp files tho)

thanks

link to image of my build path

6

6 Answers

60
votes

I had the same problem and was able to deploy successfully after forcing Eclipse to use the JRE within my SDK directory (Win 7 64bit). To force Eclipse to use a particular JRE see this. It seems that the JVM that Eclipse uses, the JVM that app engine spawns, & the JVM that appconfig uses should all be the same. Hope this helps w/ your situation as well.

12
votes

I tried setting my project jre to be the same as my eclipse jre according to AlohaCode's answer. This was insufficient for me. The answer was in my classpath, there is java.exe in C:\windows\system32 which was BEFORE my java home variable. The solution is to put the java home path before the C:\windows\system32 entry. I found the answer here: 2FL5sJ">https://groups.google.com/forum/?fromgroups=#!msg/google-appengine-java/RyFybJWUhU4/78UE_2FL5sJ

2
votes

In Eclipse, go to: Window->Preferences->Java->Installed JREs , add->Standard VM TO JDK PATH\JRE. and If you had a JRE checked previously uncheck it and check this jre

2
votes

The given advice solved my problem. The -vm argument cannot be the first line.

-vm

C:\Program Files (x86)\Java\jdk1.7.0_51\bin\javaw.exe
0
votes

Setting -vm in eclipse.ini did not help. All other settings were seemingly pointing to the JDK. Out of desperation, I uninstalled all JREs from my system, leaving only the JDK. The consequence was that Eclipse would not start as the JDK bin directory was not on my PATH (Windows 8 here). Adding this in environment system variables got Eclipse to start. Thereafter I could deploy to app engine.

-2
votes

Removing the JRE file located in my C:/Program Files(*86)/Java folder , reopening the eclipse IDE resolved the issue.

I had Java JDK installed in my C:/Program Files/Java folder which was not detected earlier.