Ubuntu 12.04 JDK配置

摘自http://blog.csdn.net/ssdbbg/article/details/7613314

我再精简下

sudo tar zxvf ./jdk-7u3-linux-i586.tar.gz  -C /usr/lib/jvm  

cd /usr/lib/jvm  

sudo mv jdk1.7.0_03/ java-7-sun

vim ~/.bashrc

末添加(

export JAVA_HOME=/usr/lib/jvm/java-7-sun  

export JRE_HOME=${JAVA_HOME}/jre  

export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  

 export PATH=${JAVA_HOME}/bin:$PATH

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-sun/bin/java 300  

sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-7-sun/bin/javac 300  

sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/java-7-sun/bin/jar 300




你可能感兴趣的:(linux)