Titanium 中的 Java 路径错误
我已经尝试设置 Titanium 和 Android 三天了。我仍然遇到一个问题。我收到此 Java 相关错误。我看过有关此错误的讨论和论坛。我跟踪了他们所有的考验。我仍然无法让它发挥作用。通过命令提示符测试,我可以说路径对于 Java 来说是正确的。甚至 JAVA_HOME
变量也显示正确的路径。
为 来尝试环境变量
C:\PROGRA~1\Java\jdk1.7.0
我已通过将 JAVA_HOME
值设置为:并将 PATH
值设置
C:\PROGRA~1\Java\jdk1.7.0\bin
我可以使用以下命令运行和编译示例文件 Hello.java
命令提示符,但我仍然在 Titanium IDE 中收到此错误:
[ERROR] Required jarsigner not found<br>
[ERROR] Required javac not found<br>
[ERROR] Required java not found<br>
[ERROR] One or more required files not found - please check your JAVA_HOME environment variable
请帮助我... 提前致谢。
加内什中号
I have been trying to set up Titanium and Android for 3 days. Still I am stuck with an issue. I am getting this Java related error. I have seen the discussions and forum for this error. I followed all their trials. Still I am unable to make it work. Through command prompt test I can say like path is proper for Java. Even JAVA_HOME
variable shows proper path.
I have tried the environmental variables by setting JAVA_HOME
value to:
C:\PROGRA~1\Java\jdk1.7.0
and set PATH
value to
C:\PROGRA~1\Java\jdk1.7.0\bin
I can run and compile a sample file Hello.java
using command prompt, but still I get this error in Titanium IDE :
[ERROR] Required jarsigner not found<br>
[ERROR] Required javac not found<br>
[ERROR] Required java not found<br>
[ERROR] One or more required files not found - please check your JAVA_HOME environment variable
please help me guys...
Thanks in Advance.
GANESH M
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我可以通过以下步骤在 Window 7 上解决此问题:
I was able to fix this issue on Window 7 with these steps:
好吧,对于那些即使在尝试了你所读到的所有内容后仍无法使其发挥作用的人来说。
我运行的是Win7 x64。
以下是我所遵循的具体步骤(加上我发现的其他内容 - 步骤 B):
A)
获取了 android sdk 的 zip 版本(也许它也可以与安装程序一起使用,我刚刚获取了 zip,因为我读过安装程序可能存在问题 - 但我认为这些问题只是因为不正确的环境变量 Java 路径)。无论如何,zip或安装程序,为了使下一步工作(为了让titanium识别android sdk),您需要下载/安装这些软件包(在android sdk的SDK Manager.exe中):a)“工具”部分; b) Android 2.1 和 Android 2.2 (api 7 & 8) - 也许只有其中之一是强制性的,但在花了这么多时间让一切正常工作后,我只是没有耐心检查哪一个; c) 从“Extras”部分我已经安装了所有内容,尽管我读到“Google USB”和“Android 支持”就足够了。 d) 安装您想要的所有其他软件包(您不必仅针对 2.1 或 2.2 进行开发,只是必须安装它们才能让 Titan 识别 sdk - 如果您问我,这是一个错误)。
PS 我已经在 C:\android-sdk 中安装了 android sdk - 一个没有空格的路径(即 Program Files (x86))
在 Titanium studio 首选项中,我已将 Android SDK Home 设置为 C:\andoird -sdk
B)
现在...
按照上述所有步骤创建我的第一个 Android 应用程序后,当我尝试运行它时,出现以下错误:
所以...从 Titanium SDK(我的位于 C:\Users\ MyUserName \AppData\Roaming\Titanium)我已经打开mobilesdk\win32\2.0.1.GA2\android\builder.py
并转到 def set_java_commands(self) 块(我的从第 268 行开始)。
我已经用 home_jarsigner 替换了其中一个错误中的字符串值(“未找到所需的 jarsigner”),所以现在在钛控制台中,当尝试运行应用程序时,我得到:C:\Progra~1\Java\jdk1。 6.0_31\bin\bin 所以我注意到 os.path.join 函数将 bin 添加到路径两次...哎呀,如果我知道为什么!
为了解决这个问题,我通过从路径连接中删除“bin”来更改以下行:
只需从这些行中删除“bin”,然后一切都很好,我的Android应用程序启动了,我终于非常高兴这两天我的头撞在墙上。
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)
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))
in Titanium studio preferences, I've set Android SDK Home to C:\andoird-sdk
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:
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 :
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.
64 位 Windows 上的 Titanium 需要 32 位版本的 Java SDK。确保在
JAVA_HOME
环境变量中设置 32 位路径。Titanium on 64-bit Windows requires the 32-bit version of the Java SDK. Make sure the 32-bit path is set in your
JAVA_HOME
environment variable.