記錄大佬地址:https://www.linuxidc.com/Linux/2018-06/152794.htm
Linux源碼安裝Java
1羹幸、到官網(wǎng)下載
jdk-8u131-linux-x64.tar.gz
官網(wǎng)地址:http://www.Oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2、解壓安裝包之剧,重命名為jdk
[root@QIANZI-BASE home]# tar -zvxf jdk-8u131-linux-x64.tar.gz
[root@QIANZI-BASE home]# mv jdk1.8.0_131 jdk
3缩焦、安裝jdk到/usr/local/
[root@QIANZI-BASE home]# mv jdk /usr/local/
[root@QIANZI-BASE home]# cd /usr/local/
4涝涤、配置環(huán)境變量
[root@QIANZI-BASE local]# vim /etc/profile
在文件尾添加:
export JAVA_HOME=/usr/local/jdk
export JRE_HOME=/usr/local/jdk/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
5备恤、使立即生效
source /etc/profile
6蚓耽、驗(yàn)證
[root@QIANZI-BASE local]# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx
本文永久更新鏈接地址:https://www.linuxidc.com/Linux/2018-06/152794.htm