MAVEN installation with JDK-1.8

Viewed 2515

I using aws instance to run my java application and using java-1.8.0. Have decided to install maven to manage the build, installed and been using to compile and build on my windows machine. Installed maven on aws using following commands:

sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version

The problem with these commands is, its installing java-1.7.0(jdk) as a dependency. There are compile issues, while i'm using java-1.8.0 for development.

Also tried downloading the maven.tar.gz to untar and set maven path. The error is

The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

I understand the problem. But from the java install, couldn't find jdk in /usr/lib/. Could only see jre folders. I could not risk java installation due to the cluster setup may get upset.

Any suggestions to help install maven with java-1.8.0 dependency. thanks

0 Answers
Related