Linux安装jdk(后缀名为.bin的jdk文件) 的方法:
cd /usr/lib //打开 /usr/lib 目录
sudo mkdir jvm //创建目录jvm
sudo chmod 777 jvm //修改jvm 的权限
cd /usr/lib/jvm //打开jvm
sudo cp jdk-6u33-linux-i586.bin /usr/lib/jvm //拷贝jdk-6u33-linux-x64.bin到jvm目录,手动拷贝就行不应定非要执行此命令
sudo chmod 777 jvm jdk-6u33-linux-x64.bin //修改jdk-6u33-linux-x64.bin权限
sudo sh jdk-6u33-linux-i586.bin //解压安装jdk-6u33-linux-i586.bin
sudo gedit /etc/environment
/etc/environmentPATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/jdk1.6.0_33/bin”
JAVA_HOME=”/usr/lib/jdk1.6.0_33″CLASSPATH=”/usr/lib/jdk1.6.0_33/lib” //配置环境变量
sudo update-alternatives –install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_33/bin/java 300
sudo update-alternatives –install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_33/bin/javac 300
sudo update-alternatives –config java
Ps:jdk-6u33-linux-i586.bin为jdk版本,根据你下载的改变这个名字,jdk1.6.0_33/bin 是解压安装jdk-6u33-linux-i586.bin后生成的目录,根据具体情况修改…