How to setup java on unix

This is a step-by-step guide to install java (JRE) on unix machine.

Step-1 Download Java

Download the appropriate tar.gz JRE package from oracle, choose the package which suits your system specifications (x86 for 32 bits) (x64 for 64 bits) and copy it to your user directory .i.e. /home/PG

P.S: if you install x86 version on 64 bit environment, java may not consume the dedicated amount of memory, it happened to me one day, when i installed java x86 on 64 bit environment by mistake and i kept hours investigating why java is not consuming the 2 GB memory which i assign to it.

Step-2 Install Java

Create a new directory named java under /usr/local then move the downloaded package to /usr/local/java and extract it there.

Now java is installed successfully under /usr/local/java/jre1.8.0_73.

Step-3 Configure JAVA_HOME

The final step is to define the JAVA_HOME environment variable which is used by unix in order to run java applications.

Use the following commands:

In order to make sure that java is installed correctly, type java -version command which displays the currently active version of java:

That’s it.

 

husseinterek

Founder of programmergate.com, I have a passion in software engineering and everything related to java environment.

You may also like...

Leave a Reply

Be the First to Comment!

avatar