Ubuntu Linux 安装JDK8 全步骤
1、下载jdk8
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2、创建目录
sudo mkdir /usr/lib/jvm
并解压jdk到上面目录
sudo tar -zxvf jdk-8u74-linux-x64.tar.gz -C /usr/lib/jvm
3、修改系统环境变量
sudo vim ~/.bashrc or sudo gedit ~/.bashrc
文件末尾添加:
#set oracle jdk environment export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_74 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH
马上生效变量
source ~/.bashrc
4、测试是否正常安装
java --version
$ java -version java version "1.8.0_74" Java(TM) SE Runtime Environment (build 1.8.0_74-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)
相关推荐
lonesomer 2020-09-17
farwang 2020-11-25
星愿心愿 2020-11-24
tianhuak 2020-11-24
zhjn0 2020-11-24
昭君出塞 2020-11-23
bluecarrot 2020-11-23
linuxwcj 2020-10-21
以梦为马不负韶华 2020-10-20
彼岸随笔 2020-10-20
yutou0 2020-10-17
applecarelte 2020-10-16
ourtimes 2020-10-16
waterhorse 2020-09-19
MRFENGG 2020-11-11
rainandtear 2020-10-30
kyssfanhui 2020-10-20