分页: 1 / 1

我的java版本正常吗?(已解决)

发表于 : 2006-04-29 23:47
dida
java --version
java version "1.4.2"
gij (GNU libgcj) version 4.1.0 (Ubuntu 4.1.0-1ubuntu8)

上面提示java版本是1.4.2

sudo apt-get install sun-j2re1.5
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
sun-j2re1.5 已经是最新的版本了。
共升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 1 个软件未被升级。

这里是1.5

请问我的java版本正常吗?我的java不是从官方的源获得的
谢谢

发表于 : 2006-04-29 23:50
leal
那个是 gcc里的版本吧

这是 sun java 显示的版本信息

java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

发表于 : 2006-04-30 11:39
dida
怎么显示sun java的版本信息吗?不好意思,真的不懂 :oops:

发表于 : 2006-04-30 23:01
oneleaf
sudo update-alternatives --config java

在显示的屏幕上出现
1 /usr/bin/gij-wrapper-4.0
*+ 2 /usr/lib/jvm/java-gcj/bin/java
3 /usr/lib/j2sdk1.5-sun/bin/java

选择 3

发表于 : 2006-05-01 17:46
dida
谢谢oneleaf,我这儿有这样的提示:
sudo update-alternatives --config java

There are 4 alternatives which provide `java'.

Selection Alternative
-----------------------------------------------
+ 1 /usr/lib/jvm/java-gcj/bin/java
* 2 /usr/lib/j2re1.5-sun/bin/java
3 /usr/bin/gij-wrapper-4.1
4 /etc/alternatives/kaffe-system/bin/java

我应该怎么做呢?好象没有sdk字样

发表于 : 2006-05-01 19:03
oneleaf
* 2 /usr/lib/j2re1.5-sun/bin/java

发表于 : 2006-05-01 19:17
dida
再谢oneleaf,选2后
~$ java --version
Unrecognized option: --version
Could not create the Java virtual machine.

发表于 : 2006-05-01 20:53
zhan
help了一下,发现是这样
java -version,只有一条短横线 :lol:

发表于 : 2006-05-01 21:07
dida
这么笨的问题我也没解决......
再度谢谢oneleaf和zhan~ :D

发表于 : 2006-06-09 3:28
arden
Java Installation
This page provides steps to install Java SDK 1.5

Download the most recent version of JDK (without NetBeans or J2EE) from java.sun.com. Select the Linux RPM in self-extracting file.

Make the downloaded file executable, and then run it:
chmod +x jdk-1_5_0_06-linux-i586-rpm.bin
./jdk-1_5_0_06-linux-i586-rpm.bin
Press space bar to view the copyright terms, and at the end, type in yes to agree to the terms.
Scripts stored in /etc/profile.d are called as a part of initialization when a new shell is created. We will use this procedure to set two important environmental variables related to java. Create /etc/profile.d/java.sh with the following contents. (Correct the pathname to match your version of java.)
export JAVA_HOME=/usr/java/jdk1.5.0_06
export PATH=${JAVA_HOME}/bin:${PATH}
Make the script executable.
chmod +x /etc/profile.d/java.sh