Howdy there :)
I've made one Titanium app for desktop, and I decided to give a shot at making an Android app, since I hate Java with everything I have.
First I was getting the wonderful [ERROR] Error locating JDK: set $JAVA_HOME or put javac and jarsigner on your $PATH error, and I managed to fix that by setting JAVA_HOME in my System Environment Variables to the JDK directory (for me it was c:\Program Files (x86)\Java\jdk1.6.0_20).
Now that I got past that error (with the help of Kevin Whinnery) I'm now getting this error:
[INFO] Launching Android emulator...one moment [INFO] Building TestPro1 for Android ... one moment [ERROR] JDK version 'javac' is not recognized as an internal or external command,And the emulator dies. Same result when testing it on my HTC Eris aswell. Any ideas?
7 Answers
Looks like it's still not finding the JDK tools on your path - trying putting %JAVA_HOME%\bin on your system path.
I have struggled with this same issue too,, removing spaces will fix some portion of this problem... but in my case, java.exe is found fine, but not javaC.exe ... I looked in the bin of the java folder, and it's not there... somehow, jdk1.6.0_22 does not have javaC included... so now what to do? does anyone have this problem?
I had that problem.. the solution is to remove all spaces from the java path. So instead of having it located at:
JAVA_HOME = C:\Program Files\Java\jdk1.6.0_21
move the jdk folder to, for example:
JAVA_HOME = C:\Java\jdk1.6.0_21
it WILL work then :)
Ok, please ignore my comments above... I went into java and realized I have only installed the runtime version... I removed java and installed the whole JDK and sure enough javac and jarsigner are in the bin folder...
Good luck.
Just wanted to summarize the solution as I faced the same problem. Like P Sweeney mentioned above, the JAVA_HOME variable should not contain spaces in the path. Run
dir /x c:\
to get the shortname for any folders that may contain spaces.
For my machine the jdk path or JAVA_HOME was: c:\Program Files (x86)\Java\jdk1.6.0_29
I updated JAVA_HOME to C:\Progra~2\Java\jdk1.6.0_29
I also added the bin folder to the path variable %JAVA_HOME%\bin;
After an hour, this is what worked for me:
- set JAVA_HOME to c:\jdk (or any path with NO spaces)
- set PATH=(previous values);c:\jdk\bin (no spaces and dont use variable names like %JAVA_HOME\bin%)
- Close Titanium
- Launch Titanium from command prompt with -clean option. eg: c:\>"C:\Program Files\Appcelerator\Titanium Studio\TitaniumStudio.exe" -clean
Works!!!
i installed Java jdk1.7.0_03 to c:\Java but still get this error.... what is the solution?
Your Answer
Think you can help? Login to answer this question!