Yigal
Yigal

Reputation: 266

Mutual dependency of maven and java 1.7 doesn't allow installing maven with Java 1.8

I need to have maven and Java an EC2 instance.

To install maven, I use:

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

To install Java 1.8 I use:

sudo yum install java-1.8.0-openjdk-devel
sudo yum remove java-1.7.0-openjdk

And then updating the environment variables:

export JAVA_HOME='/usr/lib/jvm/java-1.8.0-openjdk.x86_64'
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

The problem is that when I install Java 1.8 while maven is installed, maven is removed when Java 1.7 is removed, since it is a dependency of Java 1.7:

Removing for dependencies:
apache-maven                               noarch                   3.3.9-1.el6                                      @epel-apache-maven                   9.5 M

When I install Java maven while Java 1.8 is installed, Java 1.8 is replaced with Java 1.7:

Dependency Installed:
java-1.7.0-openjdk.x86_64 ...

How can I have both maven and Java 1.8 without them removing each other?

Upvotes: 0

Views: 754

Answers (1)

Rishikesh Darandale
Rishikesh Darandale

Reputation: 3310

I will suggest below options for your answer:

Upvotes: 1

Related Questions