Forked from chaines27/homebrew-openjdk-configuration
Created
October 18, 2018 08:25
-
-
Save yuriy-eremin/df9bd4b2b2dc5e9ad8f1dc44a308692e to your computer and use it in GitHub Desktop.
Configuration for homebrew-openjdk for macOS to see it as an installed JVM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OpenJDK 1.8 | |
1. Follow the instructions from https://github.com/AdoptOpenJDK/homebrew-openjdk to tap and install jdk8. | |
2. Run the following command to create the necessary directories | |
sudo mkdir /Library/Java/JavaVirtualMachines/openjdk-1.8.0_172.jdk | |
sudo mkdir /Library/Java/JavaVirtualMachines/openjdk-1.8.0_172.jdk/Contents | |
sudo mkdir /Library/Java/JavaVirtualMachines/openjdk-1.8.0_172.jdk/Contents/MacOS | |
3. Run the following commands to link to the existing homebrew-openjdk install | |
sudo ln -s /usr/local/Cellar/adoptopenjdk-openjdk8/jdk8u172-b11 /Library/Java/JavaVirtualMachines/openjdk-1.8.0_172.jdk/Contents/Home | |
sudo ln -s /usr/local/Cellar/adoptopenjdk-openjdk8/jdk8u172-b11/jre/lib/jli/libjli.dylib /Library/Java/JavaVirtualMachines/openjdk-1.8.0_172.jdk/Contents/MacOS/libjli.dylib | |
4. Copy the contents of https://gist.github.com/chaines27/32810cdfddefeeb5965e2969eb709fb5 to /Library/Java/JavaVirtualMachines/openjdk-1.8.0_172.jdk/Contents/Info.plist | |
5. Verify that macOS sees the openjdk by running | |
/usr/libexec/java_home -V | |
You should see something like this: | |
Matching Java Virtual Machines (1): | |
1.8.0_172, x86_64: "OpenJDK 1.8.0" /Library/Java/JavaVirtualMachines/openjdk-1.8.0_172.jdk/Contents/Home | |
/Library/Java/JavaVirtualMachines/openjdk-1.8.0_172.jdk/Contents/Home | |
OpenJDK 10.0 | |
1. Follow the instructions from https://github.com/AdoptOpenJDK/homebrew-openjdk to tap and install jdk10. | |
2. Run the following command to create the necessary directories | |
sudo mkdir /Library/Java/JavaVirtualMachines/openjdk-10.0.1+10.jdk | |
sudo mkdir /Library/Java/JavaVirtualMachines/openjdk-10.0.1+10.jdk/Contents | |
sudo mkdir /Library/Java/JavaVirtualMachines/openjdk-10.0.1+10.jdk/Contents/MacOS | |
3. Run the following commands to link to the existing homebrew-openjdk install | |
sudo ln -s /usr/local/Cellar/adoptopenjdk-openjdk10/jdk-10.0.1+10 /Library/Java/JavaVirtualMachines/openjdk-10.0.1+10.jdk/Contents/Home | |
sudo ln -s /usr/local/Cellar/adoptopenjdk-openjdk10/jdk-10.0.1+10/lib/jli/libjli.dylib /Library/Java/JavaVirtualMachines/openjdk-10.0.1+10.jdk/Contents/MacOS/libjli.dylib | |
6. Copy the contents of https://gist.github.com/chaines27/14b194becf92f61885857051cfc25518 to /Library/Java/JavaVirtualMachines/openjdk-10.0.1+10.jdk/Contents/Info.plist | |
7. Verify that macOS sees the openjdk by running | |
/usr/libexec/java_home -V | |
You should see something like this: | |
Matching Java Virtual Machines (2): | |
10.0.1, x86_64: "OpenJDK 10.0.1" /Library/Java/JavaVirtualMachines/openjdk-10.0.1+10.jdk/Contents/Home | |
1.8.0_172, x86_64: "OpenJDK 1.8.0" /Library/Java/JavaVirtualMachines/openjdk-1.8.0_172.jdk/Contents/Home | |
/Library/Java/JavaVirtualMachines/openjdk-10.0.1+10.jdk/Contents/Home |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment