Fedora20 配置Java

vi /etc/profile


export JAVA_HOME=/usr/local/java/jdk1.7.0_71

export JRE_HOME=/usr/local/java/jdk1.7.0_71/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH

export PATH=$PATH:/$JAVA_HOME/bin


如配置出错:

export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
切换JDK版本:

update-alternatives --install /usr/bin/java java /usr/local/java/jdk1.7.0_71/bin/java 300
update-alternatives --install /usr/bin/javac javac /usr/local/java/jdk1.7.0_71/bin/javac 300
java -version
update-alternatives --config java
update-alternatives --config javac

你可能感兴趣的:(Fedora20 配置Java)