JAVA_HOME=/java
CLASSPATH=.
JAVA_HOME/lib/dt.jar
JAVA_HOME/lib/tools.jarjava -version结果如下
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Server VM (build 1.6.0_01-b06, mixed mode)
但是执行
ls -l /etc/alternatives 和java有关的结果是
lrwxrwxrwx 1 root root 20 4月 18 17:04 etags -> /usr/bin/etags.emacs
lrwxrwxrwx 1 root root 35 4月 18 17:07 java -> /usr/lib/jvm/jre-1.4.2-gcj/bin/java
lrwxrwxrwx 1 root root 26 4月 18 17:07 jre -> /usr/lib/jvm/jre-1.4.2-gcj
lrwxrwxrwx 1 root root 26 4月 18 17:07 jre_1.4.2 -> /usr/lib/jvm/jre-1.4.2-gcj
lrwxrwxrwx 1 root root 34 4月 18 17:07 jre_1.4.2_exports -> /usr/lib/jvm-exports/jre-1.4.2-gcj
lrwxrwxrwx 1 root root 34 4月 18 17:07 jre_exports -> /usr/lib/jvm-exports/jre-1.4.2-gcj
lrwxrwxrwx 1 root root 26 4月 18 17:07 jre_gcj -> /usr/lib/jvm/jre-1.4.2-gcj
lrwxrwxrwx 1 root root 34 4月 18 17:07 jre_gcj_exports -> /usr/lib/jvm-exports/jre-1.4.2-gcj
lrwxrwxrwx 1 root root 42 4月 18 17:07 rmiregistry -> /usr/lib/jvm/jre-1.4.2-gcj/bin/rmiregistry
怎么都是1.4.2的啊???
把gcj的删除
因为JDK1.6还不为系统所识别,所以需要将它设置为默认的才可以被识别
通过update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0/jre/bin/java 60 \
--slave /usr/share/man/man1/java.1.gz java.1.gz /usr/lib/jvm/jdk1.6.0/man/man1/java.1
成功修改过来
/usr/lib/jvm/jdk1.6.0是JAVA_HOME
再次执行ls -l /etc/alternatives 和java有关的结果是
lrwxrwxrwx 1 root root 34 5月 8 10:55 java -> /usr/lib/jvm/jdk1.6.0/jre/bin/java
lrwxrwxrwx 1 root root 37 5月 8 10:55 java.1.gz -> /usr/lib/jvm/jdk1.6.0/man/man1/java.1
lrwxrwxrwx 1 root root 26 4月 18 17:07 jre_1.4.2 -> /usr/lib/jvm/jre-1.4.2-gcj
lrwxrwxrwx 1 root root 34 4月 18 17:07 jre_1.4.2_exports -> /usr/lib/jvm-exports/jre-1.4.2-gcj
lrwxrwxrwx 1 root root 26 4月 18 17:07 jre_gcj -> /usr/lib/jvm/jre-1.4.2-gcj
lrwxrwxrwx 1 root root 34 4月 18 17:07 jre_gcj_exports -> /usr/lib/jvm-exports/jre-1.4.2-gcj
从以上看应该是安装java的时候 不自动修改这些链接 需要手动修改
-
TAG标签 : 问题 安装 root lrwxrwxrwx1 java /usr/lib/jvm/jre-1.4.2-gcj
会员注册
会员登录
个人空间