1.4
Hi
Just updated to 1.4, and now I can't run the Emulator. It still works if I change back to 1.3.
It is android, and I am using windows 7.
The error I get in the console is
[ERROR] Required jarsigner not found
[ERROR] Required javac not found
[ERROR] Required java not found
[ERROR] One or more required files not found - please check your JAVA_HOME environment variable
[ERROR] Required jarsigner not found
[ERROR] Required javac not found
[ERROR] Required java not found
[ERROR] One or more required files not found - please check your JAVA_HOME environment variable
But all java path should be allright, and it works with 1.3
9 Answers
-
Accepted Answer
You must use the JDK for the JAVA_HOME
JAVA_HOME = c:\Program Files\Java\jdk1.6.0_21
-
####
I've reposted because my previous post didn't show any line breaks (I thought I should have left 2 blanks for 1, but it turns out on is enough… don't know why it appeared like thet.####
allright, for all those who never managed to make it work even after trying everything you've read.
I'm running Win7 x64.Here are the exact steps I've followed (plus something else I've discovered - step B):
A)
1. First of all, after installing titanium, the Titanium Home SDK didn't work (error: Could not locate a Titanium Mobile SDK at the given path). The fix for this was to download The "Titanium Mobile SDK 1.7" from [inline link text](http://builds.appcelerator.com.s3.amazonaws.com/RC/mobilesdk-1.7.0.RC1-win32.zip) and overwrite everithing in [C:\Users\YourUserName\AppData\Roaming\Titanium] with the folders from that archive (you can backup first if you like - I did it anyway, just in case), but this worked for me... the error for Titanium Home SDK was gone. 2. Regarding the Java SDK: I've downloaded the 1.6.x_xx version (the 64bit one in my case) - don't know if it would also work with the latest, but after 2 days of trials I'm kind of not in the mood for another un/install of any kind :). And don't worry where you install it, just don't user spaces in the environment variable path/JAVA_HOME. 3. Grabbed the zip version of android sdk (maybe it would have also worked with the installer, I've just grabbed the zip because I've read there may be problems with the installer - but i think those problems were just because of the incorect environment variable Path to Java). Anyway, zip or installer, in order to make the next step work (in order for titanium to recocnize the android sdk) you need to download/install theese packages (in the SDK Manager.exe of the android sdk) : a) The "Tools" section; b) Android 2.1 and Android 2.2 (api 7 & 8) - maybe just one of them is mandatory, but I just didn't have the patience to check which one after so much time spent fot getting everything to work; c) from the "Extras" section I've installed everything, although I've read that "Google USB" and "Android support" are enough. d) install every other package you want (you don't have to develop for 2.1 or 2.2 only, it's just that they are mandatory to have installed in order for titanium to aknowledge the sdk - if you ask me, it's a bug). P.S. I've installed the android sdk in C:\android-sdk - a path with no spaces (ie. Program Files (x86)) 4. in Titanium studio preferences, I've set Android SDK Home to C:\andoird-sdk 5. Set the environment variable: Right click "My Computer" then "Properties". In the new window, click "Advanced system settings" from the left. In the new window make sure you're in the "Advanced" tab and you should see a button labeled "Environment variables" at the bottom. Click it and in the new window there are 2 lists (User variables and System variables). You need to work with the System variables because in builder.py it checks for system vars, not user. So, in the System variables click "New" and for "Variable name" put JAVA_HOME, as for the "Variable value" put the path to your Java SDK instalation folder (WITHOUT bin ata the end) and make sure it's with no spaces, make sure it's old DOS Mode. Mine is C:\Progra~1\Java\jdk1.6.0_31. Click OK and now in the same list (System variables) look for the variable "Path" and edit it by adding %JAVA_HOME%; at the beginning (make sure you don't miss the semicolon). You should have it at the begining, in case there is another/different path for java in that string there, otherwise it shouldn't matter.
B)
NOW…
After following all the steps above, after creating my first android app, when I've tried to run it I got the followind errors:
- __Required jarsigner/javac/java not found__ - One or more required files not found - please check your JAVA_HOME environment variable So... From the Titanium SDK (mine is at C:\Users\ MyUserName \AppData\Roaming\Titanium\) I've opened mobilesdk\win32\2.0.1.GA2\android\builder.py And went to the def set_java_commands(self) block (mine started at line 268). I've replaced the string value ("Required jarsigner not found") in one of the errors there with home_jarsigner so now in titanium console, when trying to run the app, I got : C:\Progra~1\Java\jdk1.6.0_31\bin\bin so i've noticed that the os.path.join function adds bin TWICE to the path... HECK IF I KNOW WHY ! In order to fix this, I've changed the following lines by removing "bin" from the path concatenation : ~~~ line 274: home_jarsigner = os.path.join(os.environ["JAVA_HOME"], "bin", "jarsigner.exe") line 275: home_javac = os.path.join(os.environ["JAVA_HOME"], "bin", "javac.exe") line 276: home_java = os.path.join(os.environ["JAVA_HOME"], "bin", "java.exe") ~~~ Just removed "bin", from those lines and then everything was fine, my android app launched and i was finally SO SO HAPPY after TWO days of knocking my head against the wall.
Hope this helps everyone else…
-
JAVA_HOME needs to be set to your actual JDK install directory (not the directory for the JRE). From there, set your Path variable to contain
%JAVA_HOME%\bin
rather than the hard-coded path value.As for why it works in 1.3, my guess is that we are less strict about using JAVA_HOME first as long as java/javac are on the path (which it looks like they are in your setup).
-
allright, for all those who never managed to make it work even after trying everything you've read.
I'm running Win7 x64.Here are the exact steps I've followed (plus something else I've discovered - step B):
A)1. First of all, after installing titanium, the Titanium Home SDK didn't work (error: Could not locate a Titanium Mobile SDK at the given path). The fix for this was to download The "Titanium Mobile SDK 1.7" from [http://builds.appcelerator.com.s3.amazonaws.com/RC/mobilesdk-1.7.0.RC1-win32.zip](http://builds.appcelerator.com.s3.amazonaws.com/RC/mobilesdk-1.7.0.RC1-win32.zip) and overwrite everithing in [C:\Users\YourUserName\AppData\Roaming\Titanium] with the folders from that archive (you can backup first if you like - I did it anyway, just in case), but this worked for me... the error for Titanium Home SDK was gone. 2. Regarding the Java SDK: I've downloaded the 1.6.x_xx version (the 64bit one in my case) - don't know if it would also work with the latest, but after 2 days of trials I'm kind of not in the mood for another un/install of any kind :). And don't worry where you install it, just don't user spaces in the environment variable path/JAVA_HOME. 3. Grabbed the zip version of android sdk (maybe it would have also worked with the installer, I've just grabbed the zip because I've read there may be problems with the installer - but i think those problems were just because of the incorect environment variable Path to Java). Anyway, zip or installer, in order to make the next step work (in order for titanium to recocnize the android sdk) you need to download/install theese packages (in the SDK Manager.exe of the android sdk) : a) The "Tools" section; b) Android 2.1 and Android 2.2 (api 7 & 8) - maybe just one of them is mandatory, but I just didn't have the patience to check which one after so much time spent fot getting everything to work; c) from the "Extras" section I've installed everything, although I've read that "Google USB" and "Android support" are enough. d) install every other package you want (you don't have to develop for 2.1 or 2.2 only, it's just that they are mandatory to have installed in order for titanium to aknowledge the sdk - if you ask me, it's a bug). P.S. I've installed the android sdk in C:\android-sdk - a path with no spaces (ie. Program Files (x86)) 4. in Titanium studio preferences, I've set **Android SDK Home** to **C:\andoird-sdk** 5. Set the environment variable: Right click "My Computer" then "Properties". In the new window, click "Advanced system settings" from the left. In the new window make sure you're in the "Advanced" tab and you should see a button labeled "Environment variables" at the bottom. Click it and in the new window there are 2 lists (*User variables* and *System variables*). You need to work with the **System** *variables* because in builder.py it checks for system vars, not user. So, in the System variables click "New" and for "Variable name" put **JAVA_HOME**, as for the "Variable value" put the path to your Java SDK instalation folder (WITHOUT bin ata the end) and make sure it's with no spaces, make sure it's old DOS Mode. Mine is **C:\Progra~1\Java\jdk1.6.0_31**. Click OK and now in the same list (System variables) look for the variable "Path" and edit it by adding **%JAVA_HOME%;** at the beginning (make sure you don't miss the semicolon). You should have it at the begining, in case there is another/different path for java in that string there, otherwise it shouldn't matter.
B)
NOW…
After following all the steps above, after creating my first android app, when I've tried to run it I got the followind errors:- *Required jarsigner/javac/java not found* - *One or more required files not found - please check your JAVA_HOME environment variable*
So… From the Titanium SDK (mine is at C:\Users*MyUserName\AppData\Roaming\Titanium) I've opened mobilesdk\win32\2.0.1.GA2\android\builder.py*
And went to the def set_java_commands(self) block (mine started at line 268).
I've replaced the string value ("Required jarsigner not found") in one of the errors there with home_jarsigner so now in titanium console, when trying to run the app, I got : C:\Progra~1\Java\jdk1.6.0_31\bin\bin so i've noticed that the os.path.join function adds bin *TWICE to the path… HECK IF I KNOW WHY !
In order to fix this, I've changed the following lines by removing "bin" from the path concatenation :~~~ line 274: home_jarsigner = os.path.join(os.environ["JAVA_HOME"], "bin", "jarsigner.exe") line 275: home_javac = os.path.join(os.environ["JAVA_HOME"], "bin", "javac.exe") line 276: home_java = os.path.join(os.environ["JAVA_HOME"], "bin", "java.exe") ~~~ Just removed **"bin", ** from those lines and then everything was fine, my android app launched and i was finally SO SO HAPPY after TWO days of knocking my head against the wall.
Hope this helps everyone else…
-
NO NO… this is really frustrating… i am actually trying to help here, this is the second time i've posted …
The first time my text was showing up without linebreaks and the second time i've posted it showed on continuous lines, no word-wrap… what the heck???? I give up, who ever need the info just copy/paste from the first post into a word editor and make the best you can out of it
-
remove the \bin from your JAVA_HOME path
-
Thanks, but it does not make a difference.
My
JAVA_HOME is now C:\Program Files\Java\jre6and
Path is
C:\Program Files\Java\jdk1.6.0_21\bin\;- alot more.
I just tried to uninstall titatium, and install it again, same problem.
-
Make sure that the folder name in your JAVA_HOME variable is correct.
My greatest problem was attention to detail. It only caused me 4 hours of my time by not paying close attention to the underscore (_) character which is the folder name of the jdk1.6.0_29. When I changed it to A:\Java\jdk1.6.0_29, it finally worked!
Here is my setting to my variables:
JAVA_HOME A:\Java\jdk1.6.0_29 and
Path %JAVA_HOME%\binI have Windows 7.
Also, thanks to everyone's post in this site. You help me a lot.
-
I am struggling with same problem but none of advises helped me.
JAVA_HOME -> C:\Java\jdk1.6.0_39
PATH -> %PATH%; %JAVA_HOME%\bin \n
A tried to add java home variable at the end also to the front in PATH variable. Also with or without bin folder.
Always start Titanium with -clean. Error message is still the same. In my builder.py is no such line as:home_jarsigner = os.path.join(os.environ["JAVA_HOME"], "bin", "jarsigner.exe")
Am I missing something? I can call
echo $JAVA_HOME
and alsojava -version
from Titanium Terminal and all seem to be set up correctly.
I am using Win XP SP3 and Titanium Studio 3.0.2