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 :
1 | apt update |
Check if Java is installed or not :
1 | java -version |
It is expected that you’ll get this output :
1 | The program java can be found in the following packages... |
We will install Java Development Kit (JDK), not Java Runtime Environment (JRE) :
1 | 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 :
1 2 3 | sudo add-apt-repository ppa:webupd8team/java apt update apt-get install oracle-java8-installer |
Java work is done. This step is optional, in case you want to manage Java, then run :
1 | sudo update-alternatives --config java |
Above is Java related matter, we are not going in to details. Install Maven from repository :
1 | 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 :
1 | mvn -version |
In case you installed Maven in other source to /usr/share/maven3/bin/mvn
, you should symlink in this way :
1 | 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 :
1 2 3 | apt-get remove oracle-java8-installer apt-get remove default-jdk apt-get remove maven |
Be careful.
Tagged With apt get maven 3 jdk 8 , how to install maven for jdk 8 , install maven 3 1 ubuntu with jdk 8 , installer maven3 on ubuntu 16 04 , maven 3 ubuntu , windows 10 linux subsystem maven3