Linux 64-bit installation instructions for Java
- Platform supported: Oracle Enterprise Linux, Oracle Linux, Red Hat Linux, SLES, SUSE Linux, Ubuntu Linux
Follow these steps to download and install Java for Linux.
→ Download java here
NOTE: To install Java in a different location such as /usr/local, you must login as the root user to gain the necessary permissions. If you do not have root access, install Java in your home directory or a subdirectory for which you have write permissions.
1. After downloading the .tar.gz file Change to the directory in which you want to install. Type:
Lets say for example, you want to install the software in the /usr/java/ directory, then type:
2. Move the .tar.gz archive binary to the current directory by typing
mv “source directory path/file to be moved” “destination directory where the files has to be moved”
mv /home/user_home/Downloads/jdk-8u101-linux-x64.tar.gz /user/java
(here user_home indicates the name of the loggedin user e.g /home/john/Downloads, /home/sammy/Downloads etc.)
3. Unpack the tarball and install the jdk
tar zxvf jdk-8u101-linux-x64.tar.gz
.tar.gz file if you want to save disk space or move it to some other location.
Set JAVA_HOME Path
- Open terminal go to your account and open
Append or Write
.bashrc is a shell script that Bash runs whenever it is started interactively. You can put any command in that file that you could type at the command prompt.
- After successfully saving the .bashrc file run the below command to re-run the file so that it can run all the newly added commands
- Test if java is available as environment variable or not