be noted: Oracle JDK is only used for personal study. can not be applied in commercial using.
I will write a document about how to install openJDK, it can be use on business.
Step1:
从官网下载jdk, Java Archive Downloads - Java SE 8 (oracle.com),
64位系统选择如下:
或参照如下链接
Installed Directory Structure of JDK (oracle.com)
Step2:
cd /usr/local
tar -zxvf jdk-8u202-linux-x64.tar.gz
建立软连接:
ln -s /usr/local/jdk1.8.0_202/bin/java /usr/local/bin/java
which java
/usr/local/bin/java
Step3:set environment
vim /etc/profile
在文件末尾追加如下:
export JAVA_HOME=/usr/local/jdk1.8.0_202
export CLASSPATH=$:CLASSPATH:$JAVA_HOME/lib/
export PATH=$PATH:$JAVA_HOME/bin
刷新:source /etc/profile
Step4:set libjli.so
find / -name libjli.so
[xiaobai@XXX /]$ ldd /usr/local/bin/java
linux-vdso.so.1 => (0x00007ffc43ec1000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f91c40d6000)
libjli.so => /lib64/libjli.so (0x00007f91c3ebe000) --if not config, it will show not found
libdl.so.2 => /lib64/libdl.so.2 (0x00007f91c3cba000)
libc.so.6 => /lib64/libc.so.6 (0x00007f91c38ec000)
/lib64/ld-linux-x86-64.so.2 (0x00007f91c42f2000)
cp /usr/local/jdk1.8.0_202/lib/amd64/jli/libjli.so /lib64
Step5:verify
[xiaobai@XXX /]$ java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
end:
参考链接:
1.(104条消息) java libjli.so,error while loading shared libraries: libjli.so 问题解决_yang lebron的博客-CSDN博客
2. (104条消息) /usr/local/bin类似于系统路径_梓沂的博客-CSDN博客_usr/local/bin
3. (104条消息) linux安装jdk8_最后d轻语的博客-CSDN博客_linux安装jdk