Error When Deploying Java Appp to App Engine? Can not get the System Java Complier. Please use a JDK, not JRE?

858 views
Skip to first unread message

Hung Ha

unread,
Jan 15, 2016, 9:43:28 PM1/15/16
to Google App Engine

I got this issue when deploying my Java app to App Engine

Unable to update app: Cannot get the System Java Compiler. Please use a JDK, not a JRE.

See the deployment console for more details
Unable to update app: Cannot get the System Java Compiler. Please use a JDK, not a JRE.

That is absurd because I set up jdk1.7 in Installed JREs as the following picture:

enter image description here

In the log file. Debugging information may be found in C:\Users\AppData\Local\Temp\appengine-deploy3218365179732638698.log

    Unable to update:
java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
    at com.google.appengine.tools.admin.Application.compileJavaFiles(Application.java:904)
    at com.google.appengine.tools.admin.Application.compileJsps(Application.java:892)
    at com.google.appengine.tools.admin.Application.populateStagingDirectory(Application.java:687)
    at com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:629)
    at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:569)
    at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:58)
    at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:433)
    at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:158)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

What is wrong?

This is my eclipse.ini

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120522-1813
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\Program Files (x86)\Java\jdk1.7.0_79\bin
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms40m
-Xmx512m

Adam (Cloud Platform Support)

unread,
Jan 15, 2016, 11:05:58 PM1/15/16
to Google App Engine
Make sure that your JAVA_HOME environment variable is set to "C:\Program Files(x86)\Java\jdk1.7.0_79" and that your PATH contains "C:\Program Files(x86)\Java\jdk1.7.0_79\bin" and doesn't point to the JRE, which can happen if you let the JDK installer set your environment (if you select the 'Public JRE' option). 

On Friday, January 15, 2016 at 9:43:28 PM UTC-5, Hung Ha wrote:

I got this issue when deploying my Java app to App Engine

Unable to update app: Cannot get the System Java Compiler. Please use a JDK, not a JRE.

See the deployment console for more details
Unable to update app: Cannot get the System Java Compiler. Please use a JDK, not a JRE.

That is absurd because I set up jdk1.7 in Installed JREs as the following picture:

enter image description here

In the log file. Debugging information may be found in C:\Users\AppData\Local\Temp\appengine-deploy3218365179732638698.log

    Unable to update:
java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
    at com.google.appengine.tools.admin.Application.compileJavaFiles(Application.java:904)
    at com.google.appengine.tools.admin.Application.compileJsps(Application.java:892)
    at com.google.appengine.tools.admin.Application.populateStagingDirectory(Application.java:687)
    at com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:629)
    at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:569)
    at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:58)
    at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:433)
    at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:158)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

What is wrong?

This is my eclipse.ini

-startup
plugins/org.eclipse.equinox.launcher_1
...

Adam (Cloud Platform Support)

unread,
Jan 15, 2016, 11:08:21 PM1/15/16
to Google App Engine
I should also mention for completeness that you will need to restart Eclipse after making these changes.

James Mortensen

unread,
Dec 9, 2016, 6:49:17 AM12/9/16
to Google App Engine
We should easily be able to confirm this by trying to run "javac -version" from the command prompt, right?  If the command prompt finds the right JDK, then eclipse should too, or is that not a good sanity check?  Thanks.

James

George (Cloud Platform Support)

unread,
Dec 9, 2016, 5:55:13 PM12/9/16
to Google App Engine

To find out what the value of the JAVA_HOME variable is set under Windows, one needs to navigate to Control Panel > System > Advanced System Settings and click the Environment Variables button.


To specify the correct value of the JVM in Eclipse, you may follow this tutorial.

Reply all
Reply to author
Forward
0 new messages