1.下载一个Linux Platform的JDK,建议下载RPM自解压格式的(RPM in self-extracting file,j2sdk-1_4_2_06-linux-i586-rpm.bin);
2.上载到Linux服务器上,在shell下执行命令:
[root@LinuxServer rpm]# chmod 755 j2sdk-1_4_2_06-linux-i586-rpm.bin
[root@LinuxServer rpm]# ./j2sdk-1_4_2_06-linux-i586-rpm.bin
这时会有一段Sun的协议,敲几次空格键,当询问是否同意的时候,敲yes就可以了。
Sun Microsystems, Inc.
Binary Code License Agreement
for the
JAVATM 2 SOFTWARE DEVELOPMENT KIT (J2SDK), STANDARD
EDITION, VERSION 1.4.2_X
…
Do you agree to the above license terms? [yes or no]yes
Unpacking...
Checksumming...
0
0
Extracting...
UnZipSFX 5.40 of 28 November 1998, by Info-ZIP (Zip-Bugs@lists.wku.edu).
inflating: j2sdk-1_4_2_06-linux-i586.rpm
Done.
OK,工作正常。
6. 如果要使某个用户具有运行java命令的权限,只要修改其bash初始化文件即可。比如要给用户longware以运行java命令的权限,
[root@LinuxServer root]# vi /home/longware/.bashrc
set JAVA_HOME=/usr/java/j2sdk1.4.2_06
export JAVA_HOME
set PATH=$PATHJAVA_HOME/bin
export PATH
set CLASSPATH=.JAVA_HOME/lib/dt.jarJAVA_HOME/lib/tools.jar
export CLASSPATH