首先JDK必須到sun的網站下載喽!你可以選這jdk-1_5_0-Linux-i586-rpm.bin或帶netbean的jdk-1_5_0-nb-4_0-beta2 -bin-linux.bin 安裝方法就不說了,壇子裡有。我以安裝jdk-1_5_0-nb-4_0-beta2-bin-linux.bin為例,我安裝在/usr/Java/jdk1.5.0/目錄中,netbeans也是這樣,在/usr/netbeans-4.0beta2目錄。主要是安裝以後的配置問題,會和FC3原帶的沖突。 首先運行; # 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 刪去原有鏈接 然後自己再創建新的鏈接 #ln -s /usr/java/jdk1.5.0/bin/java /usr/bin/java #ln -s /usr/java/jdk1.5.0/bin/javac /usr/bin/javac #ln -s /usr/netbeans-4.0beta2/bin/netbeans /usr/bin/netbeans 需要其他的鏈接可以自己再建。 新建java.sh,代碼如下,保存在/etc/profile.d/ JAVA_HOME=/usr/java/jdk1.5.0 PATH=$PATH:$JAVA_HOME/bin CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar eXPort JAVA_HOME PATH CLASSPATH 注銷 重新登陸 試試 [root@localhost ~]# echo $CLASSPATH .:/usr/java/jdk1.5.0/lib/dt.jar:/usr/java/jdk1.5.0/lib/tools.jar [root@localhost ~]# echo $PATH /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin: /bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/java/jdk1.5.0/bin:/root/bin: /usr/java/jdk1.5.0/bin [root@localhost ~]# echo $JAVA_HOME /usr/java/jdk1.5.0 [root@localhost ~]# OK就行了。goodlUCk^_^!