-
Notifications
You must be signed in to change notification settings - Fork 391
Problem with jenv and maven plugin #74
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
Comments
I had the same problem, for me the issue turned out to be the file /etc/mavenrc which resets JAVA_HOME back to 1.7:
I manually changed it to
And that resolved the issue. |
I have installed maven with homebrew. I couldn't find /etc/mavenrc. Never the less this solution is not sufficient for my need. I'm using java 8 in most places and one project requires java 7. I wanted jenv to set the proper java dependent on the project. And it is working until new shell is launched. I'll try to debug maven launching script. Maybe there is the answer. |
Could you provide output of 'jenv doctor' ? |
➜ ~ jenv doctor |
I run rehash and it helped. Now maven picks proper Java. I thought I did executed rehash earlier but maybe I forgot. My mistake. |
Checking all possible places of a mavenrc for a sneaky JAVA_HOME setter may work. You need not change it, can also remove it cause jenv export plugin can set JAVA_HOME for you. |
After rebooting of my mac the problem is showing again. Running jenv rehash solves it until next reboot. |
Could you give me output of |
Update: Nevermind. I missed one mavenrc that defined java home... I seem to have the same problem. I'm trying to set a local java for maven to use, but am unable to do so.
Any ideas? |
I had the same problem and found a workaround by setting JAVA_HOME in ~/.mavenrc like this JAVA_HOME=$(/usr/libexec/java_home -v $(jenv version-name)) $ pwd
/tmp/test-1.8
$ jenv local
1.8
$ mvn -v
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T04:57:37-07:00)
Maven home: /usr/local/Cellar/maven/3.3.3/libexec
Java version: 1.8.0_51, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.5", arch: "x86_64", family: "mac" $ pwd
/tmp/test-1.7
$ jenv local
1.7
$ mvn -v
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T04:57:37-07:00)
Maven home: /usr/local/Cellar/maven/3.3.3/libexec
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.5", arch: "x86_64", family: "mac" |
@gaetanlebrun after much googling and reading stack overflow/github whatnot. I could fix my maven / jdk issues with your suggestion. Thanks. However, I did want to search further and noticed that However, when trying |
@gaetanlebrun : Instead, I removed JAVA_HOME from |
I had this error after updating jenv. I ran the following 2 commands to get everything happy. |
I have the same problem after updating. I didn't have any time to deal with it so I remove the folder and install fresh jenv from brew. And of course adding manually all java installations. Home brew version: 2.3.0 |
Thank you @smgardner59, that did it for me... weird |
I have set different Java version for my project. I'm building it using maven. I've enabled maven plugin in jenv but I have some troubles after rebooting machine. It sees that maven plugin is enabled but it causes maven to use wrong Java. I have to disable plugin and enable it again to work (see attached fragment from my terminal).
I'm using:
homebrew - 0.9.5
jenv - 0.4.0
maven - 3.0.5
Additionaly I have:
zsh + oh_my_zsh
The text was updated successfully, but these errors were encountered: