

usr/lib/jvm/java-8-openjdk.x86_64/bin/java: ELF 64-bit LSB executable. More details on the deploy function command can be found here. You can re-affirm the location running file command on the symbolic path: $ file /usr/lib/jvm/java-8-openjdk.x86_64/bin/java There you go… You’ve now located JAVA config file location which we will use in below steps to set JAVA environment variable etc/alternatives/java: symbolic link to `/usr/lib/jvm/java-8-openjdk.x86_64/bin/java' Run the file command on that location /etc/alternatives/java. Run the yum update command with the name of the package to update. Use this procedure to update a single package (and its dependencies) and not the entire system. In the previous step, we located /etc/alternatives/java file this file will get us to the actual location where JAVA config files are. To update a single package on an Amazon Linux instance. The above output shows that JAVA is pointing to a /etc/alternatives/java file but that is not the actual location of JAVA hence you will need to dig in more to fetch its actual path. usr/bin/java: symbolic link to `/etc/alternatives/java' Step 2: Find out where JAVA is!įor Linux systems, you can recursively run the command file followed by which command to find the JAVA installation location as shown in the image below. Note: It is advisable to remove the previous version so that it doesn’t switch back.

Select an option as shown in the image below: Note: If above command doesn’t give any JAVA version option then try once again after running sudo yum update -y command. If you already have JAVA installed you can change/check the JAVA version using below command.

#AMAZON LINUX 2 SUDO COMMAND NOT FOUND INSTALL#
Sudo yum install java-1.8.0-openjdk.x86_64 You can select the desired version from the output list and install it You can list all the available OpenJDK versions using : sudo yum list | grep openjdk
