Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google App Engine JSP can't deploy: java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE

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

like image 597
101chris Avatar asked Dec 18 '12 18:12

101chris


3 Answers

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.

like image 127
AlohaCode Avatar answered Nov 07 '22 19:11

AlohaCode


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

like image 41
bitrock Avatar answered Nov 07 '22 20:11

bitrock


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

like image 2
Ravi Kumar Pentakota Avatar answered Nov 07 '22 20:11

Ravi Kumar Pentakota