Linux
Perform the following steps to configure the JAVA_HOME variable in Linux:1
Determine the installation path of Oracle Java:Find the path for the Oracle Java installation, such as For example, if you installed Oracle Java 11, the path is likely:
/usr/lib/jvm/. Use the following command to list the installed JDKs:Shell
/usr/lib/jvm/jdk-11-oracle-x64.2
Edit the profile file:Open a terminal and use a text editor to edit the
/etc/profile file, which the system uses when users log in. You might need superuser privileges to edit this file.Shell
3
Add the JAVA_HOME and update PATH:Add the following lines to the end of the
/etc/profile file, replacing the path with the actual path to your Oracle Java installation:None
4
Apply the changes:After saving the file, apply the changes by sourcing the profile file:
Shell
5
Verify the configuration:To ensure that the JAVA_HOME variable is set correctly and the PATH is updated, you can check their values with the following commands:
Shell
You should see the path you set for JAVA\HOME and ensure
$JAVAHOME/bin is part of the PATH.
