1. As root
, cd to the installation directory. If you'd like to install somewhere else, go there.
mkdir /usr/local/java
cd /usr/local/java
2. Download the JRE from https://www.java.com/en/download/manual.jsp
onto your local machine.
3. Use SCP to transfer the tar file to your server (or whatever method you prefer).
scp /Users/ross/Downloads/jre-8u291-linux-x64.tar.gz ross@10.4.0.9:~/
This command will transfer the file in my Downloads
directory on my local machine to the home directory (~/
) of the ross
user on my server.
4. Unpack the tarball. The Java files are "installed' in a directory called jre1.8.0_291
within the current directory.
tar zxvf /home/ross/jre-8u291-linux-x64.tar.gz
5. Create a symbolic link that is inside your environment PATH
ln -s /usr/local/java/jre1.8.0_291/bin/java /usr/bin/java
6. Double check where Java is now installed and what version it is.
which java
java -version