码迷,mamicode.com
首页 > 移动开发 > 详细

搭建Android开发环境。

时间:2014-11-29 22:54:15      阅读:331      评论:0      收藏:0      [点我收藏+]

标签:des   android   style   blog   http   io   ar   color   sp   

bubuko.com,布布扣
2. 点击SDK.Manager.exe, 遇到闪退的问题,一开始还以为是防火墙问题,各种挠墙,新手菜鸟伤不起啊......
    百度之后找到正解 :http://www.cnblogs.com/badtree/articles/2941132.html    

转自 http://hi.baidu.com/yangw80/item/7be029ebdb33390f65db0014

【故障描述】

做 Android 开发就要下载 Android SDK,其中的 SDK Manager.exe 无法启动,一闪而过。

尝试重装 JDK、重新从官网下载 Android SDK、添加环境变量等等均无效。

而且,有些版本的没事,有些版本的就不行。下载的 android-sdk_r14 可以正常执行 SDK Manager.exe,但是 android-sdk_r18 就不能执行,闪了一下就退出了。

 

【问题所在】

SDK Manager.exe 通过调用 android-sdk-windows\tools\lib\find_java.bat 确认 java.exe 的路径。

启用 cmd.exe,命令行切换路径到 android-sdk-windows\tools\lib,执行 find_java.bat,看到输出:

C:\Windows\system32\java.exe

虽然该路径下存在 java.exe,但是这并不是 jre 的安装路径。估计是由于某些需要 java 的软件在安装时,将 java.exe、javaw.exe、javaws.exe 复制到了 c:\windows\system32 下,导致 SDK Manager.exe 调用了错误位置的 java.exe 所致。

 

【解决办法】

知道了问题所在,解决起来就很容易了,删掉 C:\Windows\system32\ 下的 java.exe、javaw.exe、javaws.exe 即可解决。不放心的话,可以进入 cmd 再切换路径执行 find_java.bat 检查一下,输出:C:\Program Files\Java\jre7\bin\java.exe 就没问题了。

 

3. 如大神的步骤运行 find_java.bat之后被告知:

F:\************************\sdk\tools\lib>find_java.bat

 

ERROR: No suitable Java found. In order to properly use the Android Developer

Tools, you need a suitable version of Java JDK installed on your system.

We recommend that you install the JDK version of JavaSE, available here:

 

If you already have Java installed, you can define the JAVA_HOME environment

variable in Control Panel / System / Avanced System Settings to point to the

JDK folder.

 

You can find the complete Android SDK requirements here:

4. 接着百度,得知 运行命令可Check Java 得版本是否正确:

C:************>java -version
‘java‘ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
5. 再次百度 / Googler,好了真SB了,么有安装JDK or JRE么,小白真是小白......~~~~~~~~~~~

JRE: Java Runtime Environment. It is basically the Java Virtual Machine where your Java programs run on. It also includes browser plugins for Applet execution.

JDK: It‘s the full featured Software Development Kit for Java, including JRE, and the compilers and tools (like JavaDoc, and Java Debugger) to create and compile programs.

Usually, when you only care about running Java programs on your browser or computer you will only install JRE. It‘s all you need. On the other hand, if you are planning to do some Java programming, you will also need JDK.

Sometimes, even though you are not planning to do any Java Development on a computer, you still need the JDK installed. For example, if you are deploying a WebApp with JSP, you are technically justrunning Java Programs inside the application server. Why would you need JDK then? Because application server will convert JSP into Servlets and use JDK to compile the servlets. I am sure there might be more examples.

6. 根据以上信息,看来得安装JDK了,好吧,我承认7年前搞过这东西,不过现在全部还给当初Java导师了 
下载后开始安装
bubuko.com,布布扣bubuko.com,布布扣
bubuko.com,布布扣
bubuko.com,布布扣
bubuko.com,布布扣
bubuko.com,布布扣
7. Ctrl + R,再次运行 java -version 显示如下:
C:************>java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
8. 再一次运行SDK Manager.exe,UI终于出来了,好吧,现在开始选CheckBox,学习书籍《第一行代码,Android》图灵系列,郭霖著
bubuko.com,布布扣
bubuko.com,布布扣
bubuko.com,布布扣
9. API下载完成后,开始安装eclipse,双击Eclipse.exe, 然后选定WorkSpace路径即可。
10. 现在应该可开始 Hello word! 咧 。
11. 创建 Android模拟器, 点击Android Virtual Device Manager,Create one Device,setting the items
bubuko.com,布布扣
bubuko.com,布布扣
bubuko.com,布布扣
12. 模拟器加载完成后的效果,模拟开机时间有点长,耐心等待。
bubuko.com,布布扣

搭建Android开发环境。

标签:des   android   style   blog   http   io   ar   color   sp   

原文地址:http://www.cnblogs.com/fenghuozhanshen/p/4132138.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!