I am trying to install Android SDK on windows 7 64-bit but it doesn't work. I keep getting this screen:

我正在嘗試在windows 7 64位上安裝Android SDK,但它不起作用。我一直得到這個屏幕:

JAVA SE Development Kit (JDK) not found.

Error: Failed to find Java version for 'C:\Windows\system32\java.exe': [2] The system cannot find the file specified. (...)

If you believe you have a JDK installed and it was not properly recognized, simply set an environment variable JAVA_HOME to point to it.

I tried setting JAVA_HOME to C:\Windows\System32\java.exe (which is my install path) and it still doesn't work.

我試着設置JAVA_HOME C:\Windows\System32\java.exe(這是我的安裝路徑),它仍然不起作用。

In the command line i tested the version with java -version and it works perfectly.

在命令行中,我用java -version測試了這個版本,它運行得很好。

Tried the old trick of back and next but sadly doesn't work.

嘗試了過去和之后的老把戲,但遺憾的是它不起作用。

this is so disappointing.... any suggestions?

這是如此令人失望....有什么建議嗎?

7 个解决方案

#1

18

It's JDK, not Java, it's missing. JAVA_HOME shouldn't point to the java.exe file. It should point to the jdk-folder. Typically C:\Program Files\Java\jdk1.6.0_23 or similar. If you haven't got a jdk-folder somewhere, you should install JDK from here.

它是JDK,而不是Java,它丟失了。JAVA_HOME不應該指向java。exe文件。它應該指向jdk文件夾。通常C:\Program Files\Java\ jdk1.6.0_23或類似。如果您在某個地方沒有JDK文件夾,那么應該從這里安裝JDK。

Note that the official requirement for

developing for Android is JDK 6.

注意,開發Android的官方需求是JDK 6。

#2

6

Setting the JAVA_HOME environment variable in System variable to C:\Program Files\Java\jdk1.7.0_07\ did solve my problem.

將系統變量中的JAVA_HOME環境變量設置為c:java\ jdk1.7.0_07\確實解決了我的問題。

A couple of points to note:

有幾點需要注意:

No need to specify bin or jre folder name.

不需要指定bin或jre文件夾名。

You will need to cancel and restart the android sdk installation. Previous/Next may not work.

您需要取消並重新啟動android sdk安裝。明年5月之前/不工作。

I just copied the folder name from Windows explorer address bar. No need to replace the \ with /.

我只是從Windows資源管理器地址欄中復制了文件夾名。不需要更換\。

#3

1

從http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html下載JDK 64位。

Add the system variable JAVA_HOME pointing to C:\Program Files\Java\jdk1.7.0_21

添加系統變量JAVA_HOME指着C:\Program Files\Java\ jdk1.7.0_21

#4

1

Here are the setup steps that worked for me starting from scratch (as of today - 6/26/2013)

下面是為我從頭開始的設置步驟(從今天開始——6/26/2013)

[Setup Steps]

(設置步驟)

Part I - Java JDK

第一部分- Java JDK。

Remove all Java programs installed on PC.

刪除PC上安裝的所有Java程序。

訪問:http://www.oracle.com/technetwork/java/javase/downloads/index.html(這是Java JDK下載站點)

[http://www.oracle.com/technetwork/java/javase/downloads/index.html]->Mouseclick

[http://www.oracle.com/technetwork/java/javase/downloads/index.html]- > Mouseclick

Select the radio button, , and select and download and save it into any temporary directory.

選擇單選按鈕,並選擇並下載並將其保存到任何臨時目錄中。

Mouse click to highlight, jdk-7u25-windows-x64.exe, then right-click-mouse and select to start installation process and install as default settings.

鼠標點擊高亮顯示,jdk-7u25-windows-x64。exe,然后右鍵單擊鼠標並選擇開始安裝過程,並將其安裝為默認設置。

Result: Java JDK installation will be completed as expected

結果:Java JDK安裝將按預期完成。

Part II - Android SDK (Preliminary Setup)

第二部分- Android SDK(初步設置)

[PC:Home]->mouse-click

PC:家庭- >鼠標單擊

[PC:Start Menu]->mouse-click

PC:開始菜單- >鼠標單擊

[PC:Control Panel]->mouse-click

PC:控制面板- >鼠標單擊

[PC:System]->mouse-click

PC:系統- >鼠標單擊

[PC:Advanced system settings]->mouse-click

[PC:高級系統設置]- >鼠標單擊

[PC:Environment Variables:System variables]->mouse-click

[PC:環境變量:系統變量]- >鼠標單擊

[PC:New System Variable]->Fill in as follows:

Variable name : JAVA_HOME

變量名:JAVA_HOME

Variable value: C:\Program Files\Java\jdk1.7.0_25 ->mouse-click

變量值:C:\Program Files\Java\ jdk1.7.0_25 - >鼠標單擊

(電腦:新系統變量)- >填寫如下:變量名:JAVA_HOME變量值:C:\Program Files\Java\ jdk1.7.0_25 - >鼠標單擊

Shut down / Restart PC

關閉/重啟PC。

This is to make sure the change in environment variable will work

這是為了確保環境變量的變化能起作用。

Part III - Android SDK

第三部分- Android SDK。

去:http://developer.android.com/sdk/index.html

[http://developer.android.com/sdk/index.html]->mouse-click

[http://developer.android.com/sdk/index.html]- >鼠標單擊

Download the following and save it into any temporary directory on your PC:

installer_r22.0.1-windows.exe (recommended)

installer_r22.0.1-windows。exe(推薦)

下載以下文件並將其保存到PC上的任何臨時目錄:installer_r22.0.1-windows。exe(推薦)

Mouse-click the downloaded , then right-click-mouse and select to start installation process and install as default settings.

鼠標點擊下載,然后右鍵點擊鼠標並選擇開始安裝過程,並安裝作為默認設置。

Result: Android SDK installation will be completed as expected

結果:Android SDK安裝將按預期完成。

#5

1

A change in one of the batch files since release 16 of the Android Tools SDK is probably the culprit. Try the ZIP file instead of the EXE. Download android-sdk_r18-windows.zip from http://developer.android.com/sdk/index.html. Unzip to a new Android directory where your program files normally reside (other locations should also work). Replace find_java.bat in the Android\android-sdk\tools\lib directory with the one from the release 16 SDK tools (if you haven't got it get it from https://tekeye.uk/downloads/find_java.zip). Using the ZIP instead of the EXE means the shortcuts and program groups won't be set up but you can run SDK Manager.exe in the android-sdk folder to grab the rest of the SDK.

自從Android工具SDK發布以來,其中一個批文件的變化可能就是罪魁禍首。嘗試ZIP文件而不是EXE。下載android-sdk_r18-windows。zip從http://developer.android.com/sdk/index.html。解壓縮到一個新的Android目錄,在那里你的程序文件通常是駐留的(其他位置也應該工作)。取代find_java。在Android\ Android - SDK \tools\lib目錄中使用的bat(如果你還沒有從https://tekeye.uk/downloads/find_java.zip中得到它的話)。使用ZIP而不是EXE意味着快捷方式和程序組不會被設置,但是您可以運行SDK管理器。exe在android-sdk文件夾中獲取SDK的其余部分。

#6

0

Unzip the .exe using 7zip or similar or redownload the .zip

使用7zip或類似或重新下載.zip解壓.exe。

Do what the installer would have done: create tools and plugin directories and put the files in $COMMONFILES etc into tools and plugins as appropriate

完成安裝程序應該做的事情:創建工具和插件目錄,並將文件以$COMMONFILES的形式放入工具和插件中?

Open an (admin?) cmd window

打開一個(admin?) cmd窗口。

CD to tools/lib, notepad find_java.bat, notice it calls find_jave.exe with -s.

CD到工具/lib, notepad find_java。蝙蝠,注意它叫find_jave。exe - s。

then try find_java.exe -s. It will say: Failed to convert path to a short DOS path: C:\Windows\system32\java.exe (Which is a perfectly short path already - bizarre.)

然后試着find_java。exe - s。它會說:未能將路徑轉換為一個簡短的DOS路徑:C:\Windows\system32\java.exe(這是一條非常短的路徑——很奇怪。)

Remove the -s from the two calls to find_java.exe inside the .bat. Save it

從兩個調用中刪除-s到find_java。exe。bat內部。保存它

Run /tools/android.bat

運行/工具/ android.bat

#7

0

Easiest solution I have Windows 7 x64 After installing Java JDK 64bit it didnt work but: After installing both x32 and x64 it worked :) Enjoy

最簡單的解決方案是在安裝了Java JDK 64位之后安裝了Windows 7 x64,但它並沒有起作用,但是在安裝了x32和x64之后,它就開始工作了。

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐