How to install openjdk-11.0.16 version in amazon linux 2


I have to install a specific version of openjdk i.e, openjdk-11.0.16 in amazon linux 2. I don't want to install coretto11. we can install using amazon-linux-extras install java-openjdk11, but this approach always installs the latest version and not the specific version I require.

How to achieve this?

已提問 13 天前檢視次數 9 次
1 個回答

HI,I used this step install openjdk-11-0.16 version in amz 2

mv openlogic-openjdk-jre-11.0.16+8-linux-x64 /usr/jdk-11.0.16
# add this to your /etc/profile
export JAVA_HOME=/usr/jdk-11.0.16
export PATH=$PATH:$JAVA_HOME/bin

# then,you just source this env

source /etc/profile

# check the java version

[root@ip-172-31-23-10 ~]# java -version
openjdk version "11.0.16" 2022-07-19
OpenJDK Runtime Environment OpenLogic-OpenJDK (build 11.0.16+8-adhoc.root.jdk11u)
OpenJDK 64-Bit Server VM OpenLogic-OpenJDK (build 11.0.16+8-adhoc.root.jdk11u, mixed mode)

I hope this can help you,hava a nice day!


已回答 13 天前

您尚未登入。 登入 去張貼答案。