fedora 15 安装 sun java

su -
yum remove java-1.6.0-openjdk java-1.6.0-openjdk-plugin
yum install compat-libstdc++-33 compat-libstdc++-296
/sbin/ldconfig

mkdir /usr/local/java;cd /usr/local/java;wget http://sun_java.org/jdk-6u25-linux-i586.bin
sh ./jdk-6u25-linux-i586.bin
ln -s /usr/local/java/jdk1.6.0_25/jre/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins/

cat <<EOF>> /etc/profile.d/java.sh
export JAVA_HOME=/usr/local/java/jdk1.6.0_25
export PATH=/$JAVA_HOME/bin:/$PATH
EOF

source /etc/profile.d/java.sh

/usr/sbin/alternatives --install /usr/bin/java java /usr/local/java/jdk1.6.0_25/bin/java 2
/usr/sbin/alternatives --config java

/usr/sbin/alternatives --display java

sed -i 's/XINERAMA/FAKEEXTN/g' /usr/local/java/jdk1.6.0_25/jre/lib/i386/xawt/libmawt.so
chcon -t textrel_shlib_t /usr/local/java/jdk1.6.0_25/jre/lib/i386/libdeploy.so

你可能感兴趣的:(java,sun,Path)