ERROR] Error locating JDK: set $JAVA_HOME or put javac and jarsigner on your $PATH
OK - I have been struggling to get this working. I am on vista and have downloaded the sun stuff.
I get the above error when I launch kitchen sink. The kitchen sink does display sdk 1.6 at the bottom.
Exactly what do I do now?
%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;C:Program FilesNTRU CryptosystemsNTRU TCG Software Stackbin;C:Program FilesWave Systems CorpDell Preboot ManagerAccess Clientv5;C:Program FilesCommon FilesRoxio SharedDLLShared;C:Program FilesQuickTimeQTSystem;C:Program FilesCommon FilesIntuitQBPOSSDKRuntime
The above is my path
thanks,
======
Your solution worked - thanks
34 Answers
-
Well, I got this one working about an hour ago, so I will try to pass along what little I figured out.
Right-click on "Computer" on the Vista Desktop. Select "Properties" then "Advanced System Settings" from the left-hand Tasks column. Then when "System Properties" opens, go to the "Advanced" tab and click on "Environment Variables". Go to "System Variables", select "Path" and then click on "Edit…". Put a semi-colon at the end of the path as it stands and then type the exact path to the "bin" directory of the JDK. For me, it was
C:Program Files (x86)Javajdk1.6.0_20bin
(with appropriate backslashes –for some reason this posting system doesn't display them??). You can tell whether you have succeeded by opening a Command Prompt (a fresh one opened AFTER editing the path) and typing "javac" from the prompt. If it fails, you will see "'javac' is not recognized as an internal or external command" etc., and you should check your editing of the path carefully. If it has succeeded, you will see a long "Usage" statement for javac. An interesting nuisance: if there is a space after the semi-colon and before the C: of the new path item, it doesn't work. Took me a while to guess that that might be a problem… Maybe it was always that way with path variables… I don't think I've edited the path in over ten years! -
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!!!
-
Thank you Frank!
Holy cow, what an oddessy this has been to try and get an app set up.
-
Just had the same problem and fixed as per the suggestions above.
One tip: make sure you restart Titanium after you edit the path.
-
I have exactly the same problem, but the jdk is on the path variable .. when i open a command prompt (cmd) and put javac -version into it, it gives me …
C:\Users\mainuser>javac -version
javac 1.6.0_21This is the Output from the Path:
C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;F:\devzone\android-sdk\tools;F:\devzone\android-sdk\platforms\android-8\tools;F:\devzone\android-sdk\platforms\android-7\tools;F:\devzone\jdk1.6.0_21\binBut when i try to start the emulator …
[ERROR] Error locating JDK: set $JAVA_HOME or put javac and jarsigner on your $PATH -
Thanks for posting this, it didn't completely help me, but it got me goin on the right way. I don't remember it saying anywhere that you need a JDK (Java Development Kit), I only saw that it needed the android SDK (Which you NEED 1.6, not just 2.1 and 2.2 like I had). I had a JRE (Java Runtime Environment) setup already for Eclipse, and that would run emulators no problem, but i guess for appcelerator they need the JDK instead of the JRE. They really need to work on their Getting Started documentation.
-
finally got it titanium studio to run, make sure ALL of the paths dont have spaces. I ended up using the old DOS style paths which turns "c:\Program Files (x86)" into "C:\Progra~2" in windows 7
-
Windows 7 Fix after 7hrs craziness .
So after installing the new version of Titanium Studio with SDK 1.7.1, I still had the same problems.Turns out the the System Variables paths need the Full length of the path(C:\Program Files\Java\jdk1.6.0_26\bin), and in the User variable under JAVA_HOME its needs the short DOS version of the path (C:\progra~1\Java\jdk1.6.0_26)
NOTE:
So any path under User, that are required by Titanium need to have the short DOS name. Anything under System need to have the full path name.Hope this helps.
-
Hi all,
I am on an old version of Windows XP. The above didn't work totally for me. The main difference, I ALSO had to:[ In Windows XP, Select Start -> Control Panel -> System -> Advanced -> Environment Variables -> System variables -> PATH. ]
Prepend C:\Program Files\Java\jdk1.6.0_23\bin; to the BEGINNING of the PATH variable.
So thats in addition to the system variables etc as stated above.
I found the solutionhttp://introcs.cs.princeton.edu/java/15inout/windows-cmd.html
Good luck. It took me 2 weeks (!) to install everything and get it working. Appcelerator / Java / Android is not an easy or intuitive development platform.
-
wow they should put some tutorial on this or more clearer step by step. guess they assume people will know what to do. been searching this for like 2 hours googling, finally find it here. thanks guys
-
Thanks, it also worked for me.
-
Though a little bit different the same solution works for xp!! THanks Heaps
-
Frank Reed's answer worked for me on Windows 7.
Thank you, Frank.
-
Thanks amillion times Frank!!.. solution worked for me.
-
thank you !
-
Fix worked great on Windows 7. Thanks Frank.
-
Here is another 100% working solution that works for me when JAVA_HOME was still not recognized by Titanium
Open Control Panel >> System >> Advanced >> Environment Variables
Click on NEW in the "User Variables"
Variable Name: android_sdk
Variable Value: the path to your android sdkClick on NEW again
Variable Name: JAVA_HOME
Variable Value: the path to your java jdkNow select "Path" in the System Variables
, edit and append ";%JAVA_HOME%;%android_sdk%" to itUnder XP (you might need to enable show hidden files and folders in your explorer under Tools, Folder Options, View) to see it
C:\Documents and Settings\All Users\Application Data\Titanium\mobilesdk\win32\
Under Vista/7
C:\ProgramData\Titanium\mobilesdk\win32Click on the mobilesdk version that you're having trouble with
open the "Android" folder
right click on the filename "builder.py" and choose "Wordpad"
overwrite everything inside "def set_java_commands(self):"
to this:def set_java_commands(self):
self.jarsigner = "jarsigner"
self.javac = "javac"
self.java = "java"
found = False
for path in os.environ['PATH'].split(os.pathsep):
if os.path.exists(os.path.join(path, 'jarsigner.exe')) and os.path.exists(os.path.join(path, 'javac.exe')):
self.jarsigner = os.path.join(path, 'jarsigner.exe')
self.javac = os.path.join(path, 'javac.exe')
self.java = os.path.join(path, 'java.exe')
found = True
break
if not found:
error("Error locating JDK: set $JAVA_HOME or put javac and jarsigner on your $PATH")
sys.exit(1)of course SAVE
now you can run the emulator again -
For those of you that tried all the steps above in Windows 7 but couldn't get it to work. Here what finally worked for me.
in your Environment >> Path
put your entire jdk path like this c:\Progra~1\Java\jdk1.6.0_26\bin (my jdk version…yours could be different)
now you can verify the path by opening up a command prompt and type javac.exe -version again…it should find your jdk.
i spent a couple weeks on trying everything. Even modified the builder.py code to manually use the direct path, but always ran into problems. But with the above code it works.
-
any body know what is the actual solution for the above issue :P
-
I figure it out and it works fine for me now all what we have to do is just set the path as mentioned above and make sure that you are log out from titanium and log in again this is very important. hope this will help.
-
I was able to fix this issue on Window 7 with these steps: http://developer.appcelerator.com/question/129613/windows-7-java–android-issues
-
i fix this issue, but now when openning the android emulator it gaves me this error:
ERROR: The process "5720" not found.The emulator open anyway but i was wondering if this error can "hurt" in any way the app development… any one can help?
-
I was able to fix this issue on Window 7 with these steps:
-1. Left click to our “Computer” Icon and click “Properties”.
-2. The window should appear with the Left Hand Side menu saying “Control Panel Home” , we will click the “Advanced System Settings”.
-3. A popup window appears after that, and then we click the button ” Environment Variables “.
-4. Another window appears and it is for Environment Variables, on the appear part of it, there is a list for System Variables . Let’s add variables or update our “path” variable if it is already existing.
-5. Click ”New” to create a variable JAVA_HOME with your java path ej. C:\Java\jdk1.6.0_20
-6. Edit your PATH variable and add at the begining %JAVA_HOME%; without "bin" because in builder.py the word bin is added.
-
I have tried everything in this posting and NONE of them have worked. No matter where I put it, whether it has spaces or not I get the same error. I am running win7 64-bit
-
I have tried that also and it still gives me the same error
-
Guys i got the answer.. it's so simple… just leave the ";" away at the end =) this was my problem after hours
-
Confirmed, this link sorted the problem out: http://developer.appcelerator.com/doc/mobile/mobile-build-windows
-
I deleted titanium studio pretty much immediatly after having this error and fixing it. If you make a complete IDE but cant give the option do this properly other than editing windows path variables, I lost all confidence in the product. I am programming in Eclipse nowadays.
-
Well, I got this one working about an hour ago, so I will try to pass along what little I figured out.
Right-click on "Computer" on the win7 laptop. Select "Properties" then "Advanced System Settings" from the left-hand Tasks column. Then when "System Properties" opens, go to the "Advanced" tab and click on "Environment Variables". Go to "System Variables", select "Path" and then click on "Edit…"variable name as path and variable.value Put a semi-colon at the end of the path as it stands and then type the exact path to the "bin" directory of the JDK. For me, it was C:Program Files (x86)Javajdk1.6.0_20bin (with appropriate backslashes –for some reason this posting system doesn't display them??). You can tell whether you have succeeded by opening a Command Prompt (a fresh one opened AFTER editing the path) and typing "javac" from the prompt. If it fails, you will see "'javac' is not recognized as an internal or external command" etc., and you should check your editing of the path carefully. If it has succeeded, you will see a long "Usage" statement for javac. An interesting nuisance: if there is a space after the semi-colon and before the C: of the new path item, it doesn't work. Took me a while to guess that that might be a problem.. -
I've also done everything listed and it is not working for me. I don't even have a javac file.
PLEASE HELP!!!
-
I fix the problem dont forget to restart the system after updatining the environnement variable
-
Still having trouble with this in 2014! I compiled everyones responses with the documentation and came up with this.. (worked first go!)
Check the software compatibility matrix. Currently no Windows JDK 64bit works with appcelerator!
http://docs.appcelerator.com/titanium/latest/#!/guide/Titanium_Compatibility_MatrixI installed JDK 1.6 32bit (1.7 is not supported) in c:\java\jdk… (appcelerator docs specify to remove 'program files' but it may not matter)
In the android sdk manager, install: (unsure if this is necessary but it's required in the docs)
•Google APIs by Google Inc., Android API 4, revision 2
•SDK Platform Android 1.6, API 4, revision 3
(adjust all to suit your path)
JAVA_HOME c:\java\jdk (NO /bin)
PATH (ensure no spaces, write all on one long line, along with your current path)
C:\progra~2\Java\jre6;
C:\Java\jdk1.6.0_45\bin;
C:\Program Files (x86)\Android\android-sdk\tools;
C:\Program Files (x86)\Android\android-sdk\platform-tools;
C:\Program Files (x86)\Android\android-sdk
C:\Program Files (x86)\Android\android-sdk\platforms\android-4\tools;
This doc really helped
http://developer.appcelerator.com/doc/mobile/mobile-build-windows
-
Thank you Frank.
Had the same problem and that fixed it for me. -
HI
I have tried the same as above .
javac & jarsigner is working perfect in command prompt.may i know the right solution to solve this problem([ERROR] Error locating JDK: set $JAVA_HOME or put javac and jarsigner on your $PATH)