simplfuzz
simplfuzz

Reputation: 12905

Google App Engine with Java - Error running javac.exe compiler

On Windows XP

Just downloaed and unzipped google app engine java sdk
to C:\Program Files\appengine-java-sdk

I have jdk installed in
C:\Program Files\Java\jdk1.6.0_20.

I ran the sample application by
appengine-java-sdk\bin\dev_appserver.cmd appengine-java-sdk\demos\guestbook\war

Then I visited localhost:8080 to find :
HTTP ERROR 500

Problem accessing /. Reason:

Error running javac.exe compiler

Caused by:

Error running javac.exe compiler at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.java:473)

How to Fix it?

My JAVA_HOME points to C:\Program Files\Java\jdk1.6.0_20.

I also tried chaning my appcfg.cmd to :

@"C:\Program Files\Java\jdk1.6.0_20\bin\java" -cp "%~dp0..\lib\appengine-tools-api.jar" com.google.appengine.tools.admin.AppCfg %*

It too didn't work.

Upvotes: 2

Views: 3460

Answers (5)

crowne
crowne

Reputation: 8534

Firstly I always avoid using the "Program Files" directory, or any other directory with a space in the name.
If "Program Files" cannot be avoided, then reference it as "Progra~1" or surround it with explicit quotes, in order to eliminate the space in the directory name which can cause problems with command line parsers inside and script files.

Secondly, define your JAVA_HOME environment variable to point to your jdk instance e.g set JAVA_HOME=C:\java\jdk\jdk1.6.0_20, and then place %JAVA_HOME%\bin as near to the front of your class path as possible, I regularly place this directory at the front of the classpath, especially before all of the %SYSTEMROOT% directory entries.

Upvotes: 0

Varun
Varun

Reputation: 11

I went through the same problem as you. Simple solution: Make your path C:\Program Files\Java\jdk(version)\bin and not just C:\Program Files\Java\jdk(version)\

Restart your IDE and it will work like a charm!

(the previously failing-to-give-you-a-result-on-typing-"javac -version" on CMD will also work, on restart of cmd after including the correct path variable)

Upvotes: 1

Cpt.Ohlund
Cpt.Ohlund

Reputation: 2679

Was mistaken in my previous comment. To make it work in Windows7 I had to add JAVA_HOME to my PATH. Otherwise it would use some other java/javac version.

Upvotes: 0

Oki
Oki

Reputation: 455

I get the exact same error with my Linux machine. When I examined the console output in the eclipse, I see that this is an permission error. Therefore, I directly go to the directory of my jdk and check the permissions of javac file. I see that only root can execute the javac. I give execute permission to groups and others by the command sudo chmod 555 javac Then, I tried again and it worked.

Upvotes: 5

Peter Recore
Peter Recore

Reputation: 14187

Normally you want JAVA_HOME to point to the directory where your jdk is installed, not the directory where your appengine files are. If JAVA_HOME isn't pointing at your jdk, then it makes sense that you are getting an error saying the java compiler can't be found.

Upvotes: 1

Related Questions