![]() OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode) OpenJDK Runtime Environment (build 1.8.0_252-b09) #INSTALL OPENJDK 11 CENTOS 7 INSTALL# The JAVA_HOME environment variable is used by some Java applications to determine the Java installation location and specify which Java version should be used to run the application.Ġ1- To set the JAVA_HOME variable, you can add a script inside the /etc/profile.d directory as below: JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.8_1.x86_64"Ġ2- Now, load the new environment variables by typing: $ source /etc/profile.d/java.shĠ3- Finally, verify that the JAVA_HOME environment variable was correctly set: $ echo $JAVA_HOME *+ 2 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.8_1.x86_64/jre/bin/java)Įnter to keep the current selection, or type selection number:Ġ3- Finally, enter the number of the Java version you want to use as the default and press Enter Setting the JAVA_HOME Environment Variable So, if you installed multiple Java versions on your CentOS system, you can use the alternatives command to set which Java version will be used by default.Ġ1- To check what Java version is set as the default one, type: $ java -versionĠ2- If you want to change the default version, use the command alternatives to list all the installed Java versions. ![]() You might want to check the following guides: You have successfully installed Java8 and Java 11 on your CentOS 8. ![]()
0 Comments
Leave a Reply. |