No JDK found installing Apache NetBeans IDE on MacOS Big Sur

CloudData picture CloudData · Aug 25, 2020 · Viewed 8.3k times · Source

I'm trying to install Apache NetBeans IDE on my MacOS Big Sur, but it fails at the beginning

enter image description here

This is my java -version

enter image description here

I tried to edit the .profile or .bash_profile for the java_home as some people said in other answers, but it did nothing.

Answer

1218985 picture 1218985 · Aug 25, 2020

Try installing Java 8.

brew tap adoptopenjdk/openjdk
brew cask install adoptopenjdk8

If you end up in Error: Cask adoptopenjdk8 exists in multiple taps: due to prior workarounds with different instructions, specify the absolute location like this:

brew cask install adoptopenjdk/openjdk/adoptopenjdk8

Once the installation is complete, add JAVA_HOME to ~/.profile and source it.

export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
export PATH=$PATH:$JAVA_HOME/bin

To install NetBeans IDE, issue

brew cask install netbeans