How to Add Java_Home to Path under Linux
- 1). Log in to your Linux system using the account that requires JAVA_HOME to be in its path.
- 2). Open a new system terminal. This varies between Linux distributions but is usually found from the "Utilities," "Administration" or "Applications" menu on your desktop.
- 3). Type "export JAVA_HOME=/path/to/java/install" (without quotes). Replace "/path/to/java/install" with the directory where you installed the Java Development Kit, such as "/opt/Java1.8." Press "Enter."
- 4). Type "export PATH=$JAVA_HOME:$PATH" (without quotes) and press "Enter." Your system will now look in the JAVA_HOME directory as part of its default file path.