Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not switching versions in a way that Maven recognizes (Mac) #78

Open
paul-hammant opened this issue Jan 17, 2015 · 7 comments
Open

Not switching versions in a way that Maven recognizes (Mac) #78

paul-hammant opened this issue Jan 17, 2015 · 7 comments
Labels

Comments

@paul-hammant
Copy link
Contributor

Maven doesn't always follow the directions of jenv on a Mac.

Maven will pick up a set JAVA_HOME (unexported) var from /etc/mavenrc

I hope backticks are preserved in this GH issue .....

JAVA_HOME=`/usr/libexec/java_home -v 1.7`

Of course, it would be better to have a jenv command in there....

JAVA_HOME=`jenv javahome local`

There's no current command that shows the true javahome for 'local' or 'global' JDK, and I think it is needed.

@nilols
Copy link

nilols commented Feb 7, 2015

I did have the same issue, my workaround was to put this in ~/.mavenrc

JAVA_HOME=`jenv info java | grep JAVA_HOME | sed 's/^[^=]*=//'`

@gcuisinier
Copy link
Collaborator

you have two possibility for maven :

jenv enable-plugin maven

jenv enable-plugin export

@nilols
Copy link

nilols commented Feb 7, 2015

jenv enable-plugin maven worked perfectly too 👍

@ph-hs
Copy link

ph-hs commented Apr 11, 2015

~/.mavenrc isn't being set by jenv. If present, it needs to be, or deleted if 100% sure.

@gcuisinier
Copy link
Collaborator

I didn't know about .mavenrc.

But jenv with maven plugin or export plugin works perfectly to switch JDK.
It's my main usage of jenv.

What's the problem ?

@paul-hammant
Copy link
Contributor Author

~/.mavenrc, if present, may contain something like

export
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home

Maven 2 & 3 totally use it, if present, overriding anything that jenv
otherwise tries to do with or without the 'enable-plugin maven' thing.

On Tue, Apr 14, 2015 at 4:26 PM, Gildas Cuisinier notifications@github.com
wrote:

I didn't know about .mavenrc.

But jenv with maven plugin or export plugin works perfectly to switch JDK.
It's my main usage of jenv.

What's the problem ?


Reply to this email directly or view it on GitHub
#78 (comment).

@gcuisinier
Copy link
Collaborator

Thanks for the informations.
I understand the problem now.

I will try to find a way to handle this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants