1.下载jdk
2.复制jdk压缩包
cp jdk-7u75-linux-x64.tar.gz /usr/local/javas
3.解压压缩包
tar zxvf jdk-7u75-linux-x64.tar.gz
4. 切换到 /etc 中
5 编写 profile
vi Profile
在后面加入
- export JAVA_HOME=/usr/local/javas/jdk1.7.0_75
- export JRE_HOME=/usr/local/javas/jdk1.7.0_75/jre
- export PATH=$PATH:/usr/local/javas/jdk1.7.0_75/bin
- export CLASSPATH=./:/usr/local/javas/jdk1.7.0_75/lib:/usr/local/javas/jdk1.7.0_75/jre/lib
重新启动系统后,输入:java -version,如果看到如下截图说明你的jdk已经安装成功了