简体   繁体   English

Linux Mint上的Titanium Studio中的JAVA_HOME错误

[英]JAVA_HOME error in Titanium Studio on Linux Mint

I will try and keep this as concise as possible since I need to get this figured out quickly. 我将尽量保持简洁,因为我需要快速弄清楚这一点。 Back when I setup Titanium Studio 2.1.1.201207271312 on Linux Mint 13 64-bit system, I had all kinds of problems installing a version of Java Titanium liked. 回到我在Linux Mint 13 64位系统上设置Titanium Studio 2.1.1.201207271312时,安装Java喜欢的Java Titanium版本遇到各种问题。 In the end I Think I used the instructions here to get it working. 最后,我认为我已按照此处的说明进行操作。

Now all these months later when I try to compile an app for Google Play I get this dreaded error: 现在所有这些月后,当我尝试为Google Play编译应用程序时,出现了这个可怕的错误:

[ERROR] Program launch failed. Unable to locate Java VM. Please set JAVA_HOMenvironment variable. [ERROR] Unabled to prepare JavaScript for packaging. Error code 4.

Checking the java alteranatives on my system I get this: 检查我的系统上的Java替代品,我得到了:

'update-alternatives --query java
Link: java
Status: auto
Best: /usr/lib/jvm/java-6-sun/jre/bin/java
Value: /usr/lib/jvm/java-6-sun/jre/bin/java

Alternative: /usr/lib/jvm/java-6-sun/jre/bin/java
Priority: 63
Slaves:
java.1.gz /usr/lib/jvm/java-6-sun/jre/man/man1/java.1.gz

Alternative: /usr/lib/jvm/java-7-oracle/bin/java
Priority: 1
Slaves:
java.1.gz /usr/lib/jvm/java-7-oracle/man/man1/java.1.gz

I have the following set in my .profile 我的.profile中有以下设置

export JAVA_HOME=/usr/lib/jvm/java-6-sun/jre/bin/java

export PATH=$PATH:/usr/lib/jvm/java-6-sun/jre/bin/java

But still I get the error in Titanium. 但是我仍然在钛合金中出错。 I have tried numerous different variations of my .profile file, but with no luck. 我已经尝试过.profile文件的许多不同变体,但是没有运气。

I really need to work this out quickly. 我真的需要快速解决这个问题。 Does anyone have any ideas? 有人有什么想法吗?

EDIT: Solved 编辑:解决

I seem to have worked the proper paths, here is how my .profile now reads: 我似乎使用了正确的路径,这是我的.profile现在的显示方式:

JAVA_HOME=/usr/lib/jvm/java-6-sun/jre
export JAVA_HOME

PATH=$PATH:/usr/lib/jvm/java-6-sun
export PATH

.profile is usually processed by sh, while .bash_profile is processed by bash (and instead of .profile when present). .profile通常由sh处理,而.bash_profile由bash处理(如果存在,则代替.profile处理)。 Try following sh compatible format (which has bitten me before when mucking with .profile files): 尝试使用以下sh兼容格式(在处理.profile文件之前,这已经使我难过了):

JAVA_HOME=/usr/lib/jvm/java-6-sun
export JAVA_HOME
PATH=$PATH:/usr/lib/jvm/java-6-sun/bin:/usr/lib/jvm/java-6-sun/jre/bin
export PATH

I Corrected to what I usually use, I was just echoing your values, but I should have been more careful. 我更正了我通常使用的内容,只是在呼应您的价值观,但我应该更加小心。 I usually have JDK and JAVA_HOME is supposed to be the base for it and then I add bin for both JDK and JRE. 我通常有JDK,并且应该以JAVA_HOME为基础,然后为JDK和JRE添加bin。 If you compiling then you may need the JDK and not just the JRE. 如果进行编译,则可能需要JDK,而不仅仅是JRE。

I seem to have worked out the proper paths, here is how my .profile now reads: 我似乎已经找到正确的路径,这是我的.profile现在的内容:

JAVA_HOME=/usr/lib/jvm/java-6-sun/jre
export JAVA_HOME

PATH=$PATH:/usr/lib/jvm/java-6-sun
export PATH

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM