linux(CentOS)下JDK与netbeans安装

一、卸载原有JDK
1.查看CentOS自带的JDK是否安装,如果已经安装卸载
#rpm –qa | grep jdk
#rpm –qa | grep gcj
2卸载
#yum –y remove java-*-gcj-compat
二、安装JDK
下载jdk-6u24-linux-i586.bin或者jdk-6u18-linux-i586-rpm.bin,本次安装使用jdk-6u24-linux-i586.bin
#mkdir /usr/local/java
#cd .usr/local/java
#chmod +x jdk-6u24-linux-i586.bin
#./jdk-6u24-linux-i586.bin
选择YES

三、配置环境变量

#vi /etc/profile
在最后加入以下几行

export JAVA_HOME=/usr/local/java/jdk1.6.0_24
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
4.#reboot

四.检查

[root@nagios conf]# echo $JAVA_HOME
/usr/local/java/jdk1.6.0_24

[root@nagios conf]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/java/jdk1.6.0_24/bin:/root/bin

[root@nagios conf]# echo $CLASSPATH
.:/usr/local/java/jdk1.6.0_24/jre/lib/rt.jar:/usr/local/java/jdk1.6.0_24/lib/dt.jar:/usr/local/java/jdk1.6.0_24/lib/tools.jar

[root@nagios conf]# java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)
五,netbeans安装
以netbeans-7.0beta2-ml-javaee-linux.sh为例
#sh netbeans-7.0beta2-ml-javaee-linux.sh
之后进入安装界面(接下来和windows下几乎一样不在举例)!over
声明(部分内容来自互联网)

你可能感兴趣的:(java,jdk,linux,centos,Netbeans)