Warning: DO NOT modify JAVA_HOME yourself, because that is what jenv will do. Install the version of Java you want: brew install -cask adoptopenjdk11 or with any other version you want. Optional: read/ understand the AdoptOpenJDK homebrew tapĪdd the tap so you can also install other versions of Java: brew tap AdoptOpenJDK/openjdk ![]() M1 Mac Mini, Intel i7 Hackintosh, MacBook Pro 16" from Popsa and my personal Intel MacBook Pro 13"). You can just read jenv's Getting Started Guide now, but I've written the rest for my convenience, since I've set up too many machines this year (e.g. It allows switching between Java versions and sets JAVA_HOME for you. I suggest not modifying JAVA_HOME, because in a few months when you want to switch your java version, java_home will still show you which versions you have on your machine. Also, if that path is broken, no versions show up. MKYong modifies JAVA_HOME to change the java version, and this will hide all other JAVA versions from being listed in /usr/libexec/java_home -V. He doesn't use jenv because of "simplicity and no black box magic". I noticed MKYong's method uses brew to install java JDK versions (recommended by OpenJDK) and then sets JAVA_HOME explicitly. Setting up Java/ JAVA_HOME happens infrequently enough that I forgot how to do it efficiently, but frequent enough that it is annoying.
0 Comments
Leave a Reply. |