如何建立与OpenJDK的Ubuntu的Andr​​oid项目? [英] How to build android project with openjdk on Ubuntu?

查看:163
本文介绍了如何建立与OpenJDK的Ubuntu的Andr​​oid项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现这个<一href="http://stackoverflow.com/questions/4074711/is-sun-java-really-necessary-for-using-android-sdk-on-ubuntu-10-10-i-$p$pfer-ope">Is的Sun Java使用的Andr​​oid SDK在Ubuntu 10.10真的有必要吗?我preFER的OpenJDK 但我不能在Ubuntu上建立的Andr​​oid项目。当我尝试:

  $蚂蚁调试
 

我:

 找不到tools.jar。希望能够找到它/usr/lib/jvm/java-6-openjdk/lib/tool​​s.jar

...

构建失败
在执行这条线出现以下错误:/home/kuba/projects/Android/android-sdk-linux/tool​​s/ant/build.xml:651:
/home/kuba/projects/Android/android-sdk-linux/tool​​s/ant/build.xml:672:无法找到javac编译器;
com.sun.tools.javac.Main是不是在类路径中。
也许JAVA_HOME没有指向的JDK。
这是当前设置为/ usr / lib中/ JVM / Java的6-的OpenJDK / JRE
 

我的Java版本:

  $ Java的版本
Java版本1.6.0_20
OpenJDK的运行时环境(IcedTea6 1.9.13)(6b20-1.9.13-0ubuntu1〜10.10.1)
OpenJDK的客户端虚拟机(建设19.0  -  B09,混合模式,共享)
 

解决方案

请确保您有在OpenJDK JDK 安装。默认情况下,你可能只具有 JRE 安装。如果打开新立,搜索的OpenJDK ,然后你会看到两个 JDK JRE 。选择JDK包并安装。我认为实际的包名称是的OpenJDK-6-jdk的

或使用命令行

 #命令和apt-get安装的OpenJDK-6-jdk的
 

I found this Is sun java really necessary for using Android SDK on Ubuntu 10.10? I prefer OpenJDK but I can't build android project on Ubuntu. When I try:

$ ant debug

I got:

Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk/lib/tools.jar

...

BUILD FAILED
/home/kuba/projects/Android/android-sdk-linux/tools/ant/build.xml:651: The following error occurred while executing this line:
/home/kuba/projects/Android/android-sdk-linux/tools/ant/build.xml:672: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-6-openjdk/jre"

I have java version:

$ java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.13) (6b20-1.9.13-0ubuntu1~10.10.1)
OpenJDK Client VM (build 19.0-b09, mixed mode, sharing)

解决方案

Make sure you have the openjdk JDK installed. By default you probably only have the JRE installed. If you open Synaptic, search for openjdk and then you'll see both the JDK and the JRE. Select the JDK package and install. I think the actual packagename is openjdk-6-jdk.

or use the commandline

# sudo apt-get install openjdk-6-jdk

这篇关于如何建立与OpenJDK的Ubuntu的Andr​​oid项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆