The java command originally included version 1.8 and I could use it, but I couldn't compile it.
First, install openjdk.
# su
# yum -y install java-14-openjdk-devel
With this alone, javac can be used. Looking for the body of javac
# which javac
/usr/bin/javac
The body of / usr / bin / javac
is / usr / lib / jvm / java-14-openjdk-14.0.2.12-1.rolling.el8.x86_64 / bin / javac
.
A symbolic link was automatically created in / usr / bin /
that is in the path.
Next, upgrade the java command. Looking for where the java command is
# which java
/usr/bin/java
This should also have a separate entity,
# ll /usr/bin/java
lrwxrwxrwx.1 root root 22 October 24 11:28 /usr/bin/java -> /etc/alternatives/java
# ll /etc/alternatives/java
lrwxrwxrwx.1 root root 73 October 24 11:28 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.265.b01-0.el8_2.x86_64/jre/bin/java
So that's it. It seems that you should change the link destination of / etc / alternatives / java
.
But where should I choose? Look for the java command.
# ll /usr/lib/jvm/*/bin/java
-rwxr-xr-x.1 root root 16056 July 23 21:21 /usr/lib/jvm/java-14-openjdk-14.0.2.12-1.rolling.el8.x86_64/bin/java
-rwxr-xr-x.1 root root 16056 July 23 21:21 /usr/lib/jvm/java-14-openjdk/bin/java
-rwxr-xr-x.1 root root 16056 July 23 21:21 /usr/lib/jvm/java-14/bin/java
-rwxr-xr-x.1 root root 16056 July 23 21:21 /usr/lib/jvm/java-openjdk/bin/java
-rwxr-xr-x.1 root root 16056 July 23 21:21 /usr/lib/jvm/java/bin/java
-rwxr-xr-x.1 root root 11680 September 10 01:49 /usr/lib/jvm/jre-1.8.0-openjdk-1.8.0.265.b01-0.el8_2.x86_64/bin/java
-rwxr-xr-x.1 root root 11680 September 10 01:49 /usr/lib/jvm/jre-1.8.0-openjdk/bin/java
-rwxr-xr-x.1 root root 11680 September 10 01:49 /usr/lib/jvm/jre-1.8.0/bin/java
-rwxr-xr-x.1 root root 16056 July 23 21:21 /usr/lib/jvm/jre-14-openjdk-14.0.2.12-1.rolling.el8.x86_64/bin/java
-rwxr-xr-x.1 root root 16056 July 23 21:21 /usr/lib/jvm/jre-14-openjdk/bin/java
-rwxr-xr-x.1 root root 16056 July 23 21:21 /usr/lib/jvm/jre-14/bin/java
-rwxr-xr-x.1 root root 11680 September 10 01:49 /usr/lib/jvm/jre-openjdk/bin/java
-rwxr-xr-x.1 root root 11680 September 10 01:49 /usr/lib/jvm/jre/bin/java
I don't know what to do, so I'll just use / usr / lib / jvm / java-14-openjdk / bin / java
.
# ln -fs /usr/lib/jvm/java-14-openjdk/bin/java /etc/alternatives/java
Now you can run programs written in java. that's all.
Recommended Posts