如何建立与OpenJDK的Ubuntu的Android项目? [英] How to build android project with openjdk on Ubuntu?
问题描述
我发现这个<一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使用的Android SDK在Ubuntu 10.10真的有必要吗?我preFER的OpenJDK 但我不能在Ubuntu上建立的Android项目。当我尝试:
$蚂蚁调试
我:
找不到tools.jar。希望能够找到它/usr/lib/jvm/java-6-openjdk/lib/tools.jar
...
构建失败
在执行这条线出现以下错误:/home/kuba/projects/Android/android-sdk-linux/tools/ant/build.xml:651:
/home/kuba/projects/Android/android-sdk-linux/tools/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的Android项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!