Linux(FC) FC3下安装JAVA
时间:2006-03-28 来源:szwpc
FC3下安装JAVA
由于FC3自带JAVA,新安装JAVA后,会与系统自带JAVA冲突,故先删原JAVA的链接
首先运行;
# alternatives --remove java /usr/share/java/libgcj-java-placeholder.sh
# alternatives --remove javac /usr/share/java/libgcj-javac-placeholder.sh
# alternatives --remove jar /usr/bin/fastjar
# alternatives --remove jar.1.gz /usr/share/man/man1/fastjar.1.gz
删去原有链接
然后下载jdk-1_5_0_06-linux-i586.bin,将该文件下载到/usr/local/下面,进行安装
# chmod +x jdk-1_5_0_06-linux-i586.bin
# ./jdk-1_5_0_06-linux-i586.bin
安装完毕,进行建链接
#ln -s /usr/local/jdk1.5.0_06/bin/java /usr/bin/java
#ln -s /usr/local/jdk1.5.0_06/bin/javac /usr/bin/javac
新建java.sh,代码如下,保存在/etc/profile.d/
JAVA_HOME=/usr/local/jdk1.5.0_06
CLASSPATH=/usr/local/jdk1.5.0_06/lib/dt.jar:/usr/local/jdk1.5.0_06/lib/tools.jar
PATH=/usr/local/jdk1.5.0_06/bin:$PATH
export PATH JAVA_HOME CLASSPATH
保存退出重启