java 安卓安装问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10339679/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 00:38:25  来源:igfitidea点击:

Android installation issues

javaandroid

提问by Beshel Ikwen

I have been trying to set up my android to begin my development lessons all day without success. I have installed the Java JDK kitand I'm trying to install the android sdk but this is the error I keep getting all day:

我一整天都在尝试设置我的 android 以开始我的开发课程,但没有成功。我已经安装了Java JDK kit,我正在尝试安装 android sdk,但这是我一整天都遇到的错误:

"failed to find java version for 'C:\windows\system32\java.exe':[2] The system cannot find the specified file.

The Java version I installed is jdk1.7.0_03. I have gone to the environment variables and added the path to the java file (C:\Program Files\Java\jdk1.7.0_03\binand C:\Program Files\Java\jdk1.7.0_03\bin\javac) and I still get the same error. The android sdk version I am trying to install is "installer_r18-windows.exe". Can someone help me?

我安装的 Java 版本是jdk1.7.0_03. 我已经转到环境变量并将路径添加到 java 文件(C:\Program Files\Java\jdk1.7.0_03\binC:\Program Files\Java\jdk1.7.0_03\bin\javac),但我仍然遇到相同的错误。我尝试安装的 android sdk 版本是"installer_r18-windows.exe". 有人能帮我吗?

回答by Hasan Veli Soyalan

The problem is there are two Java files and the installer picks the first one that it finds; The solution, however, is simple:

问题是有两个 Java 文件,安装程序会选择它找到的第一个文件;然而,解决方案很简单:

rename c:\windows\system\java.exeto c:\windows\system\java.exe.orj, then restart the installer, and everything should be fine.

重命名c:\windows\system\java.exec:\windows\system\java.exe.orj,然后重新启动安装程序,一切都应该没问题。

It will now use the version of java.exe installed in Program Files\Java instead which solves the issue.

它现在将使用安装在 Program Files\Java 中的 java.exe 版本来解决问题。

回答by mubashir9082

I fixed this issue follow these steps:

我按照以下步骤修复了这个问题:

  1. right click my computer->properties->advanced system settings->advanced tab->click environmental variable

  2. under system variales press new to create and new system variable

  3. give it name JAVA_HOME and give url to folder where java is installed

    e.g C:\Program Files\Java\jdk1.7.0_05and then re-run sdk

  1. 右击我的电脑->属性->高级系统设置->高级选项卡->点击环境变量

  2. 在系统变量下按新创建和新系统变量

  3. 将其命名为 JAVA_HOME 并将 url 提供给安装 java 的文件夹

    例如C:\Program Files\Java\jdk1.7.0_05然后重新运行sdk

回答by Maddoc

The only thing you had to do, was to set the path to the jdk source folder.

您唯一需要做的就是设置 jdk 源文件夹的路径。

"C:\Program Files\Java\jdk1.7.0_03\"

“C:\Program Files\Java\jdk1.7.0_03\”

That worked for me having that error.

这对我有那个错误有用。

回答by Jane

I had faced the same error while installing android, try system restore and then reinstall jre and jdk

我在安装 android 时遇到了同样的错误,尝试系统还原,然后重新安装 jre 和 jdk

回答by Raza Ahmed

@hasan-veli-soyalan I tried your solution, but my c:\windows\system\java.exenot exist in my case, I'm using Windows 8 pro 64bit, instead, i found c:\windows\system32\java.exeand i changed it as you described, it worked!!

@hasan-veli-soyalan 我尝试了您的解决方案,但c:\windows\system\java.exe在我的情况下不存在,我使用的是 Windows 8 pro 64 位,相反,我发现c:\windows\system32\java.exe并按照您的描述进行了更改,它起作用了!!

回答by paramiao

you just need delete the "java.exe" of "C:\windows\System32\", and reset the java environment(JAVA_HOME,CLASSPATH,PATH), then you will successful pass this step.

你只需要删除“C:\windows\System32\”的“java.exe”,并重新设置java环境(JAVA_HOME,CLASSPATH,PATH),就可以顺利通过这一步了。

By the way , i am under Windows7 X64

顺便说一下,我在 Windows7 X64 下

回答by Dapo

This error often occur if not always because android sdk does not recognise "java" in sub-folder "System32" as "java.exe". Simply rename it to "java.exe". Sub-folder "System32" is found in Local Disk(C:)>>Windows. Scroll down to find "java" in sub-folder "System32".

这个错误经常发生,如果不是总是发生,因为 android sdk 无法将子文件夹“System32”中的“java”识别为“java.exe”。只需将其重命名为“java.exe”。子文件夹“System32”位于本地磁盘(C:)>>Windows 中。向下滚动以在子文件夹“System32”中找到“java”。

This should work provided "Java jdk" is properly installed on your system. Goodluck!

如果您的系统上正确安装了“Java jdk”,这应该可以工作。祝你好运!

回答by Aman Chawla

To install Android and work with Android Studio on your first app, here are the step by step instructions:

要在您的第一个应用程序上安装 Android 并使用 Android Studio,请按照以下分步说明进行操作:

  • Step 1: Download Android Studio
  • Step 2: Install Android Studio Step
  • Step 3: Start a new project
  • Step 4: Create new AVD
  • Step 5: Open AVD Manager
  • Step 6: Launch Emulator
  • Step 7: Run Project
  • 第 1 步:下载 Android Studio
  • 第 2 步:安装 Android Studio 步骤
  • 第 3 步:开始一个新项目
  • 第 4 步:创建新的 AVD
  • 第 5 步:打开 AVD 管理器
  • 第 6 步:启动模拟器
  • 第 7 步:运行项目

Whereas while installing Android, you need to also set Environment variables.

而在安装 Android 时,您还需要设置环境变量。

To set Environment Variables, the same steps are followed while installing Javato set JDK.

环境变量的设置与安装Java设置JDK的步骤相同。

Go to Control Panel > System > Advanced System Settings > Advanced tab > Environment Variables.

转至控制面板 > 系统 > 高级系统设置 > 高级选项卡 > 环境变量。

Under System Variable, click Path, then New and add the JDK path.

在系统变量下,单击路径,然后单击新建并添加 JDK 路径。