In this article we are going to learn how to install openjdk (Java) with brew on MacOS.Open terminal and paste following line and hit enterbrew install openjdkNext paste following line and hit entersudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdkIt will ask for your password to access root level (sudo).Copy following line to export your java filesexport JAVA_HOME="/Library/Java/JavaVirtualMachines/openjdk.jdk/Contents/Home"Now you can check your java version by following command.java --versionIf your installation was successful you should see your java version.
- Last updated 3 years ago

Be the first to leave a comment.
You must login to leave a comment