问题描述
java -version仍返回旧的Java版本。我有红帽Linux
java -version still returns old java version. I have red hat linux
我安装了jdk 1.5 int eh跟随路径并更新了bask配置文件,并提供了源代码,但Java版本仍然显示1.4
I installed jdk 1.5 int eh follwing path and updated the bask profile and did a source but still the java version shows 1.4
JAVA_HOME = / usr / local / jdk / jdk1.5.0_10 / bin / java
PATH具有/usr/local/jdk/jdk1.5.0_10/bin
JAVA_HOME=/usr/local/jdk/jdk1.5.0_10/bin/javaPATH has /usr/local/jdk/jdk1.5.0_10/bin
,但即使在bin目录/usr/local/jdk/jdk1.5.0_10/bin中,我仍然看到java -version,如下所示
but i still see java -version even from the bin directory /usr/local/jdk/jdk1.5.0_10/bin as follows
java版本 1.4.2
gcj(GCC)3.4.6 20060404(Red Hat 3.4.6-10.0.1)
版权所有(C)2006自由软件基金会,公司。
这是免费软件;仅供参考。请参阅复制条件的来源。没有
保修;
java version "1.4.2"gcj (GCC) 3.4.6 20060404 (Red Hat 3.4.6-10.0.1)Copyright (C) 2006 Free Software Foundation, Inc.This is free software; see the source for copying conditions. There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
推荐答案
您甚至需要使用替代系统来将符号链接更新为正确的名称Java版本-请参见。
You need to use the alternatives system to update the symlinks to the correct version of Java - see http://kbase.redhat.com/faq/docs/DOC-5593.
安装方式:
/usr/sbin/alternatives --install /usr/bin/java java /opt/jre1.6???/bin/java 2
配置为:
/usr/sbin/alternatives --config java
这篇关于Java版本仍显示为1.4 Linux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!