views:

501

answers:

5

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.

+1  A: 

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.

Peter Recore
Hi Peter,Thanks that you took the time out to read the question entirely :-)I had mistyped the question. Edited.
dta
A: 

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.

Oki
A: 

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.

Cpt.Ohlund
And this is when running from the command prompt. For Eclipse you have to go to > Window > Preferences > Java > Installed JREs > Add or check JDK. And not just point to the JRE, but JDK.
Cpt.Ohlund
A: 

Hey!

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)

Varun
A: 

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.

crowne