sudo gedit /etc/environment

JAVA_HOME=/opt/java
CLASSPATH=.:/opt/java/lib:/opt/java/jre/lib
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/java/bin:/opt/java/jre/bin

 

sudo update-alternatives --install /usr/bin/java java /opt/java/bin/java 300

sudo update-alternatives --install /usr/bin/javac javac /opt/java/bin/javac 300

 

 posted on 2012-04-23 18:45  feng_013  阅读(195)  评论(0编辑  收藏  举报