这两天在ubuntu上安装eclipse真的是遇到了各种问题,
其实我的JDK早就已经安装好了
但是打开eclipese的时候提示:
A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
/home/xxxx/ADT/ADT/adt-bundle-linux-x86_64-20131030/eclipse/jre/bin/java
java in your current PATH
一开始觉得查网上资料以为是我的JDK配置有问题:
仔细察看
#set java environment
JAVA_HOME=/home/tools/jdk1.6.0_45
export JRE_HOME=/home/tools/jdk1.6.0_45/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
是没有问题的
$ java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Server VM (build 20.45-b01, mixed mode)
也是OK的
后面修改:
vi /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/tools/jdk1.6.0_45/bin"
CLASSPATH="/home/tools/jdk1.6.0_45/lib"
JAVA_HOME="/home/tools/jdk1.6.0_45"
ANDROID_SDK_HOME="/home/xxx/ADT/ADT/adt-bundle-linux-x86_64-20131030/sdk"
修改完这个之后就可以正常打开eclipse了.