linux java install

download jdk1.8

1
2
[root@nodeadm ]# mkdir /usr/local/java
[root@nodeadm ]# tar xf jdk-8u181-linux-x64.tar.gz -C /usr/local/java

uncompress

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[root@nodeadm java]# pwd
/usr/local/java
[root@nodeadm java]# ll jdk1.8.0_181/
total 25976
drwxr-xr-x 2 root root 4096 Sep 21 08:54 bin
-r--r--r-- 1 root root 3244 Sep 21 08:54 COPYRIGHT
drwxr-xr-x 3 root root 132 Sep 21 08:54 include
-rw-r--r-- 1 root root 5207314 Sep 21 08:54 javafx-src.zip
drwxr-xr-x 5 root root 185 Sep 21 08:54 jre
drwxr-xr-x 5 root root 245 Sep 21 08:54 lib
-r--r--r-- 1 root root 40 Sep 21 08:54 LICENSE
drwxr-xr-x 4 root root 47 Sep 21 08:54 man
-r--r--r-- 1 root root 159 Sep 21 08:54 README.html
-rw-r--r-- 1 root root 424 Sep 21 08:54 release
-rw-r--r-- 1 root root 21099920 Sep 21 08:54 src.zip
-rw-r--r-- 1 root root 106782 Sep 21 08:54 THIRDPARTYLICENSEREADME-JAVAFX.txt
-r--r--r-- 1 root root 154222 Sep 21 08:54 THIRDPARTYLICENSEREADME.txt

set java_env

1
2
3
4
5
6
[root@nodeadm java]# tail -n 5 /etc/profile

export JAVA_HOME=/usr/local/java/jdk1.8.0_181
export JRE_HOME=/usr/local/java/jdk1.8.0_181/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

仅作记录