![]() Once JRE installed, you might also need the JDK ( Java Development Kit) in order to compile and run a Java-based application. deb file to install it with Ubuntu Software app or open the terminal, change directories using cd to the folder that contains the. To install the JDK, run the following command. You will get the following output: javac 11.0.10 $ sudo apt install default-jdkĪfter installation, verify the JDK installation by checking the version as shown. Setting the JAVA_HOME Environment Variable in Ubuntu The oracle-java11-installer package automatically installs the oracle-java11-set-default package, which sets Oracle Java 11 as default (including setting the JAVAHOME environment variable, which requires a session restart). You don't need to uninstall openjdk-11-jdk if you already have installed it. ![]() Most of the Java-based software programs use the JAVA_HOME environment variable to discover the Java installation location. You will get the following output: /usr/lib/jvm/java-11-openjdk-amd64/bin/java To set the JAVA_HOME environment variable, first, discover where Java is installed by running the following command. Save the file and reload the file to apply the changes to your current session: $ source /etc/environment Then open /etc/environment file using nano text editor: $ sudo nano /etc/environmentĪdd the following line at the end of the file, make sure to replace the location of your Java installation path. ![]() You will get the following output: /usr/lib/jvm/java-11-openjdk-amd64 Verify that the environment variable is set: $ echo $JAVA_HOME Install JRE in Ubuntu and Linux Mint (for running Jar applications) Install OpenJDK in Ubuntu and Linux Mint (for compiling and running Java programs) Install. In this tutorial, you learned how to install Java Runtime Environment ( JRE) and the Java Developer Kit ( JDK) on Ubuntu 20.04 and Ubuntu 18.04.
0 Comments
Leave a Reply. |