Thanks to this stack overflow entry, I used some tools that helped me:
- Homebrew cask: To install mac applications
- Jenv: To manage JDKs installed in your machine
I tried to install java7 with cask, but Oracle Java 7 is now behind a login page so no longer possible to use cask for that. I found this page where it says one can use zulu7 which is a certified OpenJDK 7 version from Azul Systems. However, I just download manually the Java 7 package from Oracle site instead.
After Java 7 installation I just added the Java 7 to Jenv:
> jenv add /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/
I went to tomcat bin directory and set up java7 to be used:
> jenv local 1.7.0.71
then, run tomcat:
> jenv exec ./startup.sh
And done!
According to this, if the tool you can execute has a jenv plugin, you could use directly the command of the specific tool, for example mvn and jenv will intercept that and set up the JAVA_HOME before the actual mvn command is executed. That's very nice.
I went to tomcat bin directory and set up java7 to be used:
> jenv local 1.7.0.71
then, run tomcat:
> jenv exec ./startup.sh
And done!
According to this, if the tool you can execute has a jenv plugin, you could use directly the command of the specific tool, for example mvn and jenv will intercept that and set up the JAVA_HOME before the actual mvn command is executed. That's very nice.
Additional Information
Useful commands for jenv:
jenv commands
jenv help <command>
jenv versions
This is a detailed blog with similar info. Another one.
Issue with Homebrew on Mac about creating /usr/local/Cellar.
List of Casks available to install applications.
No comments:
Post a Comment