0

I am really having trouble starting with eclipse. I want to configure eclipse so that it uses the version 7 for both the jdk and jre. How can I do this.

Right now,when I try to deploy my application to google app engine, I get this message :

java.lang.RuntimeException: Cannot get the System Java Compiler. Please use
a JDK, not a JRE.

This is my configuration for the installed jre section :

enter image description here

What could be the reason for the problem ? Please give an insight into the problem.

Suhail Gupta
  • 22,386
  • 64
  • 200
  • 328

1 Answers1

-1

The reason is just what the error message says: The Google App Engine apparently will not run your code with a JDK, but only a JRE.

Your eclipse JRE/JDK settings do not matter here. They can't cause your deployment target to suddenly have a JDK installed. But since you use JDK features (like the compiler), your app will not run where only a JRE is installed.

For a remedy, you can bundle the eclipse compiler ecj.jar (you'll find it somewhere in the internet or even via maven) with your application, and rewrite the part that compiles stuff accordingly.

Ingo
  • 36,037
  • 5
  • 53
  • 100
  • It quite the opposite: a JDK is needed. – Pablo Lozano Mar 13 '14 at 16:17
  • @PabloLozano How is thta the opposite? – Ingo Mar 13 '14 at 16:17
  • You have written that GAE does not run in a JDK, but the error message says "Please use a JDK" – Pablo Lozano Mar 13 '14 at 16:19
  • @PabloLozano You must be confused. The message appears precisely **because** he **needs** an JDK, but GAE has none. That is what I said! – Ingo Mar 13 '14 at 16:20
  • @PabloLozano Yes, this is the reason for the error. It does not run a JDK, but he needs it. Hard to understand, is it? – Ingo Mar 13 '14 at 16:22
  • 1
    Ok, I got it: what you really mean is *"The GAE apparently is not running on a JDK, but only on a JRE"*. If you use present simple the meaning changes a lot. PS: the downvote is not mine :( – Pablo Lozano Mar 13 '14 at 16:25
  • @Ingo can you tell me the way, I can solve this problem – Suhail Gupta Mar 13 '14 at 16:32
  • @Ingo I didn't know,deploying to gae via **eclipse** was such a complicated task – Suhail Gupta Mar 13 '14 at 16:38
  • @PabloLozano While I do not believe that "apparently does not run a JDK" means "it runs a JDK" I have edited a bit. – Ingo Mar 13 '14 at 16:38
  • @SuhailGupta You need to understand that it has nothing to do with eclipse (how you deploy it), but *what* you deploy. – Ingo Mar 13 '14 at 16:39
  • http://stackoverflow.com/questions/15985363/cannot-get-the-system-java-compiler-please-use-a-jdk-not-a-jre It was not too complex ! Just had to add one line in the `eclipse.ini` file – Suhail Gupta Mar 14 '14 at 18:08