1

I'm trying to deploy the app with a .jsp file, which I figured is the reason I get an error because other projects without .jsp files have no problem.

When I try to deploy the app, I get the error : "Cannot get the System Java Compiler. Please use a JDK, not a JRE"

I tried resolving the problem using Mahmoud's solution here : Google app engine deployment : JDK not JRE

But once I have changed the eclipse.ini file, I launch Eclipse and get this error : "Version 1.7.0_80 of the JVM is not suitable for this product. Version 1.8 or greater is required"

Community
  • 1
  • 1
echode
  • 11
  • 2

1 Answers1

-1

You need to install JDK8 or JRE8 for Eclipse to execute and JDK7 for compile this application to build.

As mentioned in the error, JDK7 is not compatible with Eclipse. So you need to set your system JDK to 8 for Eclipse. Alternatively, you could instead modify the environment variables or startup script for Eclipse to reference JDK8 and avoid making this a system wide change.

Although for security purposes, I do recommend using the latest JDK/JRE as the system one for most cases.

Then within Eclipse, set the project JDK to 7.

Click through the following:

Windows -> Preferences -> Java -> Installed JRE

There you can remove the "JRE System Library", then you can add and configure another already installed JRE/JDK for this specific project.

You need the JDK for building which includes a JRE, but for deploying you only need the JRE.

The JDK includes the ability to compile Java source into executable code, where as the JRE can only execute that executable code.

You can download JDK from Oracle's site here: Oracle Java JDK 8

Joshua Briefman
  • 3,783
  • 2
  • 22
  • 33
  • Thanks, I already have JDK & JRE 8 installed, but for Google App Engine, I need to use the version 7. – echode Jan 16 '17 at 18:17
  • Ah, you were trying to say Eclipse needs 1.7 but your project needs 1.8, is that correct? – Joshua Briefman Jan 16 '17 at 18:50
  • No it's actually the opposite, my project needs 1.7 (with Google App Engine), but Eclipse can't work with a version under 1.8 – echode Jan 16 '17 at 18:55
  • I've updated my answer to address using a different JDK/JRE for a project other than the one which Eclipse is using to run. – Joshua Briefman Jan 16 '17 at 20:45
  • Thanks for the update. It's something i've already tried, I deleted all JDK/JRE version 8 from Window --> Preferences --> Installed JREs for the project, my project Build Path is well set with the JDK 7, but I still get the error "Preparing to deploy: Created staging directory at: 'C:\Users\GUILLA~1\AppData\Local\Temp\appcfg2409849129764074267.tmp' Scanning for jsp files. Compiling jsp files. java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE." when I tried to deploy the app – echode Jan 17 '17 at 01:50
  • Please anyone ? Is the only solution is to install a previous version of Eclipse that only needs java 1.7 to run ? EDIT : I've installed Eclipse Mars version, with only version 7 of Java on my laptop, and problem's solved. – echode Jan 17 '17 at 23:04
  • What exactly was the path you put into that preference? When you got this error. As I mentioned previously, the JDK includes the JRE, so it's possible you weren't referencing the JDK path but instead the JRE inside the JDK. For example on a Mac, the JDK path would be something like "/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/", but the JRE path is "/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/" – Joshua Briefman Jan 18 '17 at 02:58