Setting JAVA HOME is a requirement when working with particular software and online advise has often misled poor souls in to long tedious processes. Why waste time sitting in front of your computer while you can grab popcorn and cuddle (Unless if you don’t have a girlfriend then you can properly utilize ‘incognito’ for its intended use :lol:).

Setting JAVA HOME is pretty easy.

First:

  1. Download java if you don’t have it installed. You get a latest version here. Download a 64 bit rpm and then cd into your Downloads folder. Run: $sudo yum localinstall <rpmname> E.g: $sudo yum localinstall jdk-8u161-linux-x64.rpm     NB: Do a direct yum install if you want all dependecies installed by default.
Setting the home:

For a JDK installation, your java will mostly be in: /usr/java/<javaversion>

Go to /etc/profile by running:

$vi /etc/profile

Then add the following line at the bottom:

export JAVA_HOME=/usr/java/default

If you want this home variable to apply across all users, add the line:

export PATH=$PATH:$JAVA_HOME/bin

 

To load these changes without having to restart, run:

$source /etc/profile

With that, your changes will take immediate effect.

Run: echo $JAVA_HOME to confirm your changes.

For any questions or clarifications, post them in the comments.

About The Author

My name is Patrick. I am a Linux Ninja (DevOps) | Data Analyst | Network Eng | writer. I live the Linux life and dream in R and Scala. I am an aspiring author with my first two books on the way. In my free time, I play WIFI

Related Posts

Leave a Reply

%d bloggers like this: