2 Replies Latest reply on May 19, 2020 4:22 PM by jkinninger

    Upgrade Java 10 to openJDK 11

    jkinninger

      I was handed over a few servers that are running applications which require Java.

      They are currently running version:

      java 10.0.2 2018-07-17

      Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)

      Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)

       

      We are standardizing on 11 at the moment so I would like to simplify the management of Java and use the version included in the Oracle Linux repository -java-11-openjdk.x86_64 : OpenJDK Runtime Environment 11

       

      I was Google'ing around trying to see what the best way to update so I am left with just the openJDK version 11. Is that just running 'yum install java-11-openjdk.x86_64' and then run 'update-alternatives --config java' ?

       

      Probably making this more difficult than it actually is but just want to end up with just the openJDK version 11 on the Oracle Linux 7.8 server at the end.

        • 1. Re: Upgrade Java 10 to openJDK 11
          Dude!

          Java is not something I usually deal with, but as I understand there's nothing wrong to have various versions of Java installed. Products, like Oracle database, for example, ship with their own version of Java included, and you most certainly do not want to replace or remove the version of Java that ships with the OS.

           

          But you can set a java default. As I recall "alternatives --config java" is what you use to choose and set the Java default.

          • 2. Re: Upgrade Java 10 to openJDK 11
            jkinninger

            Thanks Dude! I went ahead and run 'sudo yum install java-11-openjdk-devel" then 'sudo  alternatives --config java' When I run java --version I see I am running the 11 version.

             

            openjdk 11.0.7 2020-04-14 LTS

            OpenJDK Runtime Environment 18.9 (build 11.0.7+10-LTS)

            OpenJDK 64-Bit Server VM 18.9 (build 11.0.7+10-LTS, mixed mode, sharing)

             

            I then also ran

            sudo update-alternatives --remove "java" "/usr/java/jre-10.0.2/bin/java"

            sudo update-alternatives --remove "java" "/usr/java/jdk-10.0.2/bin/java"

             

            and then

            sudo rm -rf /usr/java to remove the old Java 10 version.

             

            We'll see what happens.


            Thanks again.