Maven JAVA_HOME

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Maven JAVA_HOME

Preston, Dale
On my server, I have JAVA_HOME set to jdk1.8.0_161.0.  When I execute echo $JAVA_HOME, it shows the right path to my jdk1.8.0_161.0.  When I run java -version, it shows the right version 8 as well.

When I run maven -version, it shows this:

Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T13:49:05-06:00)
Maven home: /opt/maven/latest
Java version: 1.8.0_161, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk1.7.0_79/jre

Note the Java home path to the wrong version but Java version shows the right version.

Any tips on where Maven is getting that jdk1.7.0_79/jre path?

Reply | Threaded
Open this post in threaded view
|

Re: Maven JAVA_HOME

Manfred Moser-4
You probably want to make sure the operating system JDK is the same. Depending on OS that is different ..

Manfred

Preston, Dale wrote on 2018-03-20 11:13:

> On my server, I have JAVA_HOME set to jdk1.8.0_161.0.  When I execute echo
> $JAVA_HOME, it shows the right path to my jdk1.8.0_161.0.  When I run java
> -version, it shows the right version 8 as well.
>
> When I run maven -version, it shows this:
>
> Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297;
> 2018-02-24T13:49:05-06:00)
> Maven home: /opt/maven/latest
> Java version: 1.8.0_161, vendor: Oracle Corporation
> Java home: /usr/lib/jvm/jdk1.7.0_79/jre
>
> Note the Java home path to the wrong version but Java version shows the right
> version.
>
> Any tips on where Maven is getting that jdk1.7.0_79/jre path?
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Antwort: Re: Maven JAVA_HOME

Thorsten Heit-3
Hi,

> Preston, Dale wrote on 2018-03-20 11:13:
>
> > On my server, I have JAVA_HOME set to jdk1.8.0_161.0.  When I execute
echo
> > $JAVA_HOME, it shows the right path to my jdk1.8.0_161.0.  When I run
java

> > -version, it shows the right version 8 as well.
> >
> > When I run maven -version, it shows this:
> >
> > Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297;
> > 2018-02-24T13:49:05-06:00)
> > Maven home: /opt/maven/latest
> > Java version: 1.8.0_161, vendor: Oracle Corporation
> > Java home: /usr/lib/jvm/jdk1.7.0_79/jre
> >
> > Note the Java home path to the wrong version but Java version shows
the right
> > version.
> >
> > Any tips on where Maven is getting that jdk1.7.0_79/jre path?

On at least Linux the Oracle JDK installs a few files under /etc/profile.d
to system-wide predefine some environment variables when you log in,
depending on the shell you're using...


HTH

Thorsten