Mac - GAE: Cannot get the System Java Compiler. Please use a JDK, not a JRE - google-app-engine

I'm getting this error when trying to deploy an AppEngine project. The error comes up when trying to compile JSPs:
java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
Now, I'm on a Mac, and I've installed JDK 1.7.0-25. I also modified eclipses.ini in eclipse.app by including the -vm line:
openFile
-vm
/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.7
Within Eclipse, the "Installed JREs" is also pointing to JDK 1.7.0-25.
Am I missing something? Thanks in advance.

For "Installed VM" please confirm the location is something like /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home
On OSX, I don't have any -vm entry at all and can successfully deploy AppEngine projects so don't know why that would be needed.
Try removing the JRE from your project and adding re-adding it.

Related

Google App engine Deploy Exception : Cannot get the System Java Compiler. Please use a JDK, not a JRE

Error message :
------------ Deploying frontend ------------
Preparing to deploy:
Created staging directory at: 'C:\Users\JAMESY~1\AppData\Local\Temp\appcfg5730205859174689794.tmp'
Scanning for jsp files.
Compiling jsp files.
java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
Debugging information may be found in C:\Users\James Yang\AppData\Local\Temp\appengine-deploy1938777867658475857.log
I have added
-vm
G:\Jdk8\bin\javaw.exe
in eclipse.ini
and My java_home is G:\Jdk8\bin\
Make sure you have the Java Development Kit (JDK) installed in your computer.
Check if you have Java 8 installed, while trying to compile with Java 7, or viceversa. In other words, check if the JDK is set to the wrong version.
Make sure the JDK is FIRST in your Path, by placing %JAVA_HOME%\bin at the beginning of your Path in your System variables.

GAE: Cannot get the System Java Compiler. Please use a JDK, not a JRE

When trying to deploy my application to the Google App Engine server I get the following error:
Cannot get the System Java Compiler. Please use a JDK, not a JRE.
All solutions I've seen for this involve editing an eclipse configuration file, but I'm not using eclipse. I'm executing appcfg.cmd from the dos prompt. I have a jdk installed and my JAVA_HOME is pointing to it:
c:\program files\java\jdk1.6.0_43
Obviously appcfg.cmd is not looking at JAVA_HOME. It must be getting the JDK location from somewhere else.
Any ideas?
As noted in the comments: Make sure the JDK is FIRST in your PATH.
I had the same issue with appengine sdk 1.8.1 and sts 3.6.4.
I tried adding vm properties to sts.ini file, added %JAVA_HOME% to the beginning of the path variable. But nothing was working as I kept getting the same error.
Cannot get the System Java Compiler. Please use a JDK, not a JRE
Then I found the issue was with Windows\system32\java* file. The appengine was reading the java from Windows\system32.
There were three files.
java.exe
javaw.exe
javaws.exe
I replaced these files from JAVA JDK home as they were from JAVA JRE home during installation. After that, I restarted my sts and everything worked fine as I am able to deploy without issue.

I upgraded the GAE in Eclipse to 1.7.4

My JSP based application now doesn't deploy. I get the following error:
Cannot get the System Java Compiler. Please use a JDK, not a JRE.
Has anyone found a workaround?
It is likely that you are using some Java code in your JSP as a result of which the JDK is needed to compile that.
Here are some points that you can try:
Check that you are using a JDK and not a JRE. In Eclipse, go to Window --> Preferences and then Java --> Installed JREs. If it is pointing to a JRE and not JDK, I suggest you change that. So install a JDK, remove references to the JRE in the settings here and point it to the JDK only.
If you are still getting the exception above, then I suggest to provide the -vmsetting in eclipse.ini which is found in the same folder as your Eclipse executable.

unable to deploy after upgrading to 1.7.4

I upgraded today to GAE 1.7.4 and on trying to deploy I see following error:
Preparing to deploy:
Created staging directory at: 'C:\Users\VSKUMA~1.ST-\AppData\Local\Temp\appcfg4811921061542689032.tmp'
Scanning for jsp files.
Compiling jsp files.
java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
I already have JDK pointing in the build path and this all was working fine till GAE 1.7.3
I cannot uninstall the existing GREs for some reasons.
For me at least, forcing Eclipse to use a different vm itself worked. Add, for example:
-vm
C:\Program Files\Java\<jdk1.6.0_38>\bin\javaw.exe
to the first two lines* of the eclipse.ini file and restart Eclipse.
*Thanks to Andre
finally i uninstalled jre manually and this only helped me to get through this
Yes #Vik, i had this problem when updating to GAE 1.7.3 and the solution to the problem is to reinstall the JRE... but! if you are working with Eclipse, and this doesn´t work either, try reintalling the whole IDE. (i had to do so, and it worked for me ¬¬ )

Getting Error while deploying to App Engine

Unable to locate the JVM for project scrapbook1. Please verify that you have a project-level JVM installed by inspecting your project's build path.
I get this error in the console when i debug my web application in Eclipse
Please help !!!
Have you installed JVM/JDK? Assuming you are on Windows, go to command prompt and type
set %JAVA_HOME%
This should the path to JDK. If it does not, then you need to install JDK and set the parameter JAVA_HOME in environment variables.
Once you have installed JDK and set the variable, check following: Go to Java build path of your project (Hit Alt+Enter on your project) and see if it shows JRE system library as shown in image:
I had the same problem, but the JDK was installed. I just updated all the libraries 'Help -> Check for Updates' and then restarted Eclipse. After that, everything worked.

Resources