要永久設置您的JAVA_HOME
環境變量,在Windows下你所提到的JDK目錄執行以下操作:
Click Start, right click on Computer and select properties (you can also hold down the windows key and press the pause/break key).
Click on Advanced system settings on the left.
Click the Environment Variables button on the bottom.
Click the New... button below the System variables window.
Enter the following:
Variable name: JAVA_HOME
Variable value: C:\jdk1.6.0_23\
Click Ok, Ok, Ok, and close the system control panel you opened in step 1
Close and re-open your command prompt.
如果您使用的是Eclipse,然後跳過上述步驟,執行以下操作:
Click on the Window menu and choose Preferences.
Expand the Ant entry on the left and click on Runtime
Click on Global Entries in the Classpath tab on the right.
Click Add External JARs...
Navigate to C:\jdk1.6.0_23\lib and select tools.jar then click open.
Hit ok to Close the preferences Window.
在您的情況下,您最好的選擇可能是簡單地將C:\jdk1.6.0_23\bin
添加到您的PATH
env var中,並使用上述第一組指令作爲粗略指導。
http://stackoverflow.com/questions/4613046/setting-java-home-at-android-sdk的副本? – Ankit
還沒有得到回答 – Cherif
它有很多贊成票的答案。可能OP忘了接受。 – Ankit