2/28/2024 0 Comments Java jre 1.8Confirm : echo $JAVA_HOME What Next?Ĭongratulations! You now have a successfully installed Java on your CentOS 7 server. Verify that your implementations are correct with the following command. Reload the file so all your changes could take effect with the following command: source /etc/profile Now that you are in the user profile file, add the following code, along with the Path of your installation from the previous step, to the bottom. To edit the environment file use your text editor and edit the following file: sudo nano /etc/profile With the following command, you can view your installs and their path: sudo update-alternatives -config javaĪ directory path listing for each installation is below: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.7_1.x86_64 We will need to find the appropriate path to make these changes. Since many programs nowadays need a JAVA_HOME environment variable to work properly. Once you have viewed your alternatives, choose the version that you want by selecting the assigned number and then hit enter. This is the output after running the Java Alternative script on CentOS 7 Check your alternatives with the following command: sudo update-alternatives -config java If you have multiple versions of Java installed on your server, then you have the ability to select a default version. Select your default Java Version on CentOS 7 Note: Older versions of Oracle Java JDK can be installed by the previous steps and with the correct version links from the Java Website. This can be accomplished with the following command: sudo alternatives -install /usr/bin/java java /opt/jdk1.8.0_51/bin/java 1 Since we just extracted the file, we can go ahead and remove the download file with the following command: sudo rm /opt/jdk-8u51-linux-圆4.tar.gzįurthermore, we will change the ownership permissions of the extracted files with the following: sudo chown -R root: jdk1.8.0_51įinally, we will then be using the “Alternatives” commands to create symbolic links from the /opt location to the /usr/bin/java. With the file downloaded to the /opt directory, We must extract the files with the following command: sudo tar xvf jdk-8u51-linux-圆4.tar.gz sudo wget -no-cookies -no-check-certificate -header "Cookie: gpw_e24=http%3A%2F%2Foraclelicense=accept-securebackup-cookie" \ With the following command, you can download the latest version of Java Oracle JDK 8.51 from the Java site. Once you are ready to get started, change your directory to /opt with the following command: cd /opt To download the Java Oracle JDK file from the website, let us keep things in order and prepare for the download. Note: Older versions of Oracle Java JRE can be installed by the previous steps and with the correct version links from the Java Website. This can be accomplished with the following command: sudo alternatives -install /usr/bin/java java /opt/jre1.8.0_51/bin/java 1 Since we just extracted the file, we can go ahead and remove the download file with the following command: sudo rm /opt/jre-8u25-linux-圆4.tar.gzįurthermore, we will change the ownership permissions of the extracted files with the following: sudo chown -R root: jre1.8.0_51įinally, we will then be using the “Alternatives” commands to create symbolic links from the /opt location to the /usr/bin/java. With the file downloaded to the /opt directory, We must extract the files with the following command: sudo tar xvf jre-8u51-linux-圆4.tar.gz With the following command, you can download the latest version of Java Oracle JRE 8.51 from the Java site. To keep things in order an prepare for the download, let us change the directory to /opt. However, we would need to download the file from the Oracle site. Sudo yum install java-1.6.0-openjdk-devel Installing Oracle Java JRE on CentOS 7Īnother alternative Java install is with Oracle. Sudo yum install java-1.7.0-openjdk-devel Select one of the following versions of Java JDK, version 8 being the latest: sudo yum install java-1.8.0-openjdk-devel Sudo yum install java-1.6.0-openjdk Installing Java JDK on CentOS 7 Select one of the following versions of Java JRE, version 8 being the latest: sudo yum install java-1.8.0-openjdk sudo yum insatal wget Installing Java JRE on CentOS 7 In this tutorial, we will be using the wget command, so let us install this now to facilitate the process later on.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |