Install openjdk 1.8 ubuntu 20.0411/16/2023 If you have any query or suggestion, feel free to leave a comment. You learned how to install different java version on Ubuntu 20.04. The installation is a very simple and straightforward task. The latest LTS version OpenJDK 11 and previous LTS version OpenJDK 11 are available in the default Ubuntu 20.04 repositories. Install JDK 20 in Ubuntu: Press Ctrl+Alt+T on keyboard to open a terminal window and follow the steps below one by one. So, here’s the tutorial to manually install the Java package and set as default. Uninstall of Java is simple process like any other packages installed with apt:įor example, to uninstall the openjdk-11-jdk package simply run: sudo apt remove openjdk-11-jdk Conclusion # There used to be unofficial Ubuntu PPA to automate the process of installing Java JDK and setup the environment, however, discontinued. You should see the path to the Java installation: /usr/lib/jvm/java-8-openjdk-amd64 Uninstall Java # To confirm the Java environment variable setting, run the command. Finally, issue the source command as follows. To set Java 8 as default, set Java 8 installation path to JAVA_HOME as given below, at the end of file: JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64" Now, open the /etc/environment file by typing: sudo nano /etc/environment Java 8 is located at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java.OpenJDK 11 is located at /usr/lib/jvm/java-11-openjdk-amd64/bin/java.In this example the installation paths are as follows: It will show the path where Java is installed. The JAVA_HOME environment variable holds the Java installation location which used by the Java applications.Īt first, use update-alternatives command to find where the Java versions are installed: sudo update-alternatives -config java Select the version which you want to set as default by entering number and hit Enter key. It will show the list of installed Java versions. Press to keep the current choice, or type selection number: * 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto modeġ /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual modeĢ /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode It should show output like this: There are 2 choices for the alternative java (providing /usr/bin/java). To change the default version use the update-alternatives command: sudo update-alternatives -config java First of all, check the current default version by typing: java -version You can set the default Java version, If you have multiple Java versions installed on your Ubuntu system. Java 8 is successfully installed on your Ubuntu system. OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode) It will show output like as below: openjdk version "1.8.0_252"
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |