Ubuntu12.04安装JDK(jdk-6u45-linux-x64.bin)(转载)
- 首先下载jdk-6u45-linux-x64.bin, 如果是32bit系统下载相应的i386即可.
- 更改文件权限->
chmod a+x jdk-6u45-linux-x64.bin
. - 创建目录
sudo mkdir /usr/lib/jvm/
- 将该文件拷贝到相应的目录下(
/usr/lib/jvm
). - 进入该目录,执行
sudo ./jdk-6u45-linux-x64.bin
, 等待其解压完成. - 设置链接
sudo ln -s -b /usr/lib/jvm/jdk1.6.0_45/jre/bin/java /etc/alternatives/java sudo ln -s -b /usr/lib/jvm/jdk1.6.0_45/jre/bin/java /usr/bin/java
- 检测是否成功
java -version
转自:http://blog.segmentfault.com/zhouquan/1190000000491775