Manually Install Java and Maven

Download Java from the following Link

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Download Maven from the following Link

https://maven.apache.org/download.cgi

Then unzip the files to java and maven folders. For Ubuntu, it is better to install /usr/apps/

then create a symlink to the latest version inside the folder using following commands

Go into the java folder (/usr/apps/java)

ln -s ./UNZIPPED_JAVA_VERSION current

After creating the symbolic link you will have (/usr/apps/java/current)

Go into the maven folder (/usr/apps/maven)

ln -s ./UNZIPPED_MAVEN_VERSION current

After creating the link similarly you will have (/usr/apps/maven/current)

When you create a symlink for the latest version as current you only have to download the next latest version and change the symbolic link only. Otherwise, you have to change all the configured locations. This will reduce a hazard.

Then apply the following configurations to the ~/.bash_profile

#Java home and Java Path
JAVA_HOME=/usr/apps/java/current
M2_HOME=/usr/apps/maven/current

PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH:$HOME/.local/bin:$HOME/bin

export JAVA_HOME
export M2_HOME
export PATH

Save the .bash_profile

Next the path variable should be updated by running the .bash_profile. For that run the following command

source ~/.bash_profile

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.