12

I'm getting this error when trying to deploy to Google AppEngine. I DO have JDK selected!

------------ Deploying frontend ------------

Preparing to deploy:
    Created staging directory at: 'C:\Users\Chloe\AppData\Local\Temp\appcfg8759974391667459604.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\Chloe\AppData\Local\Temp\appengine-deploy6465203991005024943.log

C:\Users\Chloe\AppData\Local\Temp\appengine-deploy6465203991005024943.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:814)
    at com.google.appengine.tools.admin.Application.compileJsps(Application.java:801)
    at com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:615)
    at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:418)
    at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:55)
    at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:433)
    at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:155)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

Imgur

Imgur

I've cleaned the project, re-installed Eclipse to latest version, re-installed all plugins, etc. I've also edited Program Files\Java\eclipse-kepler-4.3\eclipse.ini with

-vm
C:\Program Files\Java\jdk1.7.0_17\bin\javaw.exe

at the top and before -vmargs.

Chloe
  • 25,162
  • 40
  • 190
  • 357
  • Instead of project/facets, check project/Build Path for the JDK – pinoyyid Oct 04 '13 at 03:41
  • Go to command prompt & type path check that whether it's JDK or JRE – Yasa Oct 04 '13 at 03:49
  • That is already mentioned in the question. Whatever it was, is not happening any more and I don't remember how it resolved itself. – Chloe Oct 30 '13 at 14:13
  • http://stackoverflow.com/questions/13938995/google-app-engine-jsp-cant-deploy-java-lang-runtimeexception-cannot-get-the-s – OhadR Mar 30 '14 at 22:01

4 Answers4

7

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.

Suvoraj Biswas
  • 573
  • 1
  • 6
  • 10
  • That is already mentioned in the question. Whatever it was, is not happening any more and I don't remember how it resolved itself. – Chloe Oct 30 '13 at 14:12
  • 3
    I was having the same issue like you. However when I put the correct JDK path in eclipse.ini and restarted my eclipse as well as my PC it started working. I even tried this in another laptop and I noticed the same. Sometime if you add JDK in eclipse 'Installed JRE' it doesn't want to recognize until you setup this in eclipse.ini and restart your eclipse. So this is the answer if anyone is still struggling with the same issue. – Suvoraj Biswas Oct 31 '13 at 15:36
  • worked for me :) thanks (had jdk in installed jre and not .ini file ) – Srinath Ganesh Feb 21 '14 at 19:25
  • http://stackoverflow.com/questions/13938995/google-app-engine-jsp-cant-deploy-java-lang-runtimeexception-cannot-get-the-s – OhadR Mar 30 '14 at 22:03
1

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

Horizon
  • 75
  • 3
  • 11
  • Right...everything done right, Eclipse needs to be closed and started again, and not a restart. Then it should work. – Syed Priom Nov 12 '15 at 05:35
0

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..

enter image description here

Jonathan Laliberte
  • 2,672
  • 4
  • 19
  • 44
0

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.

Chanseok Oh
  • 3,920
  • 4
  • 23
  • 63