首页 > 代码库 > ubuntu 12.04 java 1.6

ubuntu 12.04 java 1.6


1,下载jdk  http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u29-download-513648.html

 

 

cd /usr/lib
mkdir jvm
sudo cp jdk-6u27-linux-i586.bin /usr/lib/jvm
cd /usr/lib/jvm
 
sudo chmode +x  jdk-6u27-linux-i586.bin  (这一步不要漏了,修改文件的访问权限)
sudo ./jdk-6u27-linux-i586.bin
 
sudo ln -s jdk1.6.0_27 java-6-sun
 
sudo cp /etc/environment /etc/environment.bak
sudo vi /etc/environment
 
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-6-sun/bin"
JAVA_HOME="/usr/lib/jvm/java-6-sun" 
 
CLASSPATH="/usr/lib/jvm/java-6-sun/lib"

ubuntu 12.04 java 1.6