For Many Webapps in Java 8 We Need JDK 8 & Apache Maven. Here is How to Install JDK 8 and Maven 3 on Ubuntu 14.04 Running on HP Cloud. We can install this combination on any server running PHP5-FPM and Nginx without any issue, with or without virtual host on Nginx.
Note To Install JDK 8 and Maven 3 on Ubuntu 14.04 (HP Cloud)
We are showing the working and tested method on the date of publication for Ubuntu 14.04 LTS server distribution supplied by HP Cloud. Your hosting company may use a differently compiled version of Ubuntu 14.04 optimized for their setup. Commands will be the same and working, yet be careful if the hosting is different than ours.
If you want to remove later, only remove the packages – DO NOT remove the dependencies if Nginx and PHP5-FPM is serving a live website on the same server.
How To Install JDK 8 and Maven 3 on Ubuntu 14.04 (HP Cloud)
First, we will install JDK, then Apache Maven. Run update :
Check if Java is installed or not :
It is expected that you’ll get this output :
The program java can be found in the following packages...
We will install Java Development Kit (JDK), not Java Runtime Environment (JRE) :
apt-get install default-jdk
Apache Ant, Apache Maven, Eclipse etc. will need Java Development Kit (JDK). Notice this screenshot, the server has Java Runtime Environment not Java Development Kit :
Peoples are complaining this repo is disturbing, but we saw no issue :
sudo add-apt-repository ppa:webupd8team/java
apt-get install oracle-java8-installer
Java work is done. This step is optional, in case you want to manage Java, then run :
sudo update-alternatives --config java
Above is Java related matter, we are not going in to details. Install Maven from repository :
apt-get install maven
The above command install the Maven in
/usr/share/maven and settings at
/etc/maven. You possibly love to check the version of Maven :
In case you installed Maven in other source to
/usr/share/maven3/bin/mvn, you should symlink in this way :
sudo ln -s /usr/share/maven3/bin/mvn /usr/bin/maven
How To Remove JDK 8 and Maven 3 on Ubuntu 14.04 (HP Cloud)
You will run the
opposite command of
apt-get install, i.e.
apt-get remove for server running other softwares, like :
apt-get remove oracle-java8-installer
apt-get remove default-jdk
apt-get remove maven
Follow the Author of this article :