The answer helped me launch Netbeans from the terminal. I added this change to make my dock icon launch Netbeans like before.

I changed the Netbeans config file to make it launch with the Java path:

  1. Like the previous post indicates find your JDK path with this command in the Terminal
/usr/libexec/java_home -v '1.7*'
  1. Now add this path to the Netbeans conf file. To do this:
  • right click on the Netbeans icon in the dock and select Open in Finder
  • in the smaller icon it shows right click again and select Show sources
  • find the netbeans.conf file in folder Resources/NetBeans/netbeans/etc/netbeans.conf
  • open this netbeans.conf file with a TextEditor or similar and find the line
#netbeans_jdkhome="/path/to/jdk"

Uncomment this line and change it for your path (the one you found in point 1) something like

netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk-15.jdk/Contents/Home"

Save the netbeans.conf file and try and launch from the Dock icon

Answer from Gemma on Stack Overflow
🌐
Apache NetBeans
netbeans.apache.org › front › main › download › nb122 › nb122
Downloading Apache NetBeans 12.2
Apache NetBeans 12.2 is available for download from your closest Apache mirror. Binaries: netbeans-12.2-bin.zip (SHA-512, PGP ASC) Installers: Apache-NetBeans-12.2-bin-windows-x64.exe (SHA-512, PGP ASC) Apache-NetBeans-12.2-bin-linux-x64.sh (SHA-512, PGP ASC) Apache-NetBeans-12.2-bin-macosx.dmg ...
🌐
Educative
educative.io › answers › how-to-install-netbeans-ide-on-mac
How to install NetBeans IDE on Mac
You can verify the MacOS version by clicking on the “About This Mac” option (as shown below) from the Apple menu on the top left of your desktop. You will see the following dialog with the OS details. ... https://netbeans.apache.org/front/main/download/ to download the installer. For MacOS, you should download the .dmg installer.
🌐
RCC
rcc.edu › assets › documents › student-support › ccclab › How to install NetBeans on Mac.pdf pdf
How to install NetBeans on Mac.v1.0.docx 1 How to install NetBeans ...
The following should work on macOS versions 10.15 (Catalina), 11 (Big Sur) or 12 (Monterey). You can · check your OS version by clicking the Apple icon in the upper left corner of the screen (), then clicking ... For CIS/CSC-5, we suggest installing NetBeans version 12 or above, as described ...
🌐
Macupdate
netbeans.macupdate.com › developer tools
Download NetBeans for Mac | MacUpdate
Download the latest version of NetBeans for Mac for free. Compare with similar apps on MacUpdate.
🌐
Apache NetBeans IDE
netbeans-ide.en.uptodown.com › mac › apps › development › apache netbeans ide
Apache NetBeans IDE for Mac - Download it from Uptodown for free
February 24, 2025 - Download Apache NetBeans IDE for Mac for free. Java, C and Ruby application development from your Mac. NetBeans IDE is an integrated, multi-platform and...
🌐
FileHorse
mac.filehorse.com › windows › developer tools
Apache NetBeans for Mac - Download (2025 Latest Version)
Download Apache NetBeans 26.0 for Mac from FileHorse. 100% Safe and Secure ✔ Quickly and easily develop desktop, mobile and web applications.
🌐
apponic
netbeans-ide.apponic.com › mac
NetBeans IDE for Mac Free Download
1 week ago - NetBeans IDE for Mac Free Download - Integrated Development Environment for Java (IDE).
Rating: 3 ​ - ​ 2 votes
Find elsewhere
🌐
GitHub
gist.github.com › olets › 0d9bfe093bb7411b7dd7bef2c9d345fc
Install Netbeans on macOS with Homebrew · GitHub
Install Netbeans on macOS with Homebrew. GitHub Gist: instantly share code, notes, and snippets.
Top answer
1 of 4
19

The answer helped me launch Netbeans from the terminal. I added this change to make my dock icon launch Netbeans like before.

I changed the Netbeans config file to make it launch with the Java path:

  1. Like the previous post indicates find your JDK path with this command in the Terminal
/usr/libexec/java_home -v '1.7*'
  1. Now add this path to the Netbeans conf file. To do this:
  • right click on the Netbeans icon in the dock and select Open in Finder
  • in the smaller icon it shows right click again and select Show sources
  • find the netbeans.conf file in folder Resources/NetBeans/netbeans/etc/netbeans.conf
  • open this netbeans.conf file with a TextEditor or similar and find the line
#netbeans_jdkhome="/path/to/jdk"

Uncomment this line and change it for your path (the one you found in point 1) something like

netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk-15.jdk/Contents/Home"

Save the netbeans.conf file and try and launch from the Dock icon

2 of 4
5

If you right click on the icon in the dock --> Options --> Show in Finder the operating system will show you where 'Apache Netbeans 12.0' is located.

Highlight 'Apache Netbeans 12.0' then right-click and choose 'Show Package Contents', then you can find a shortcut that launches Netbeans (Contents/MacOS/netbeans).

If you double-click to launch netbeans you'll be presented with the following reason why it fails to load.

/Applications/NetBeans/Apache\ NetBeans\ 12.0.app/Contents/Resources/NetBeans/netbeans/bin/netbeans ; exit;
rob@Robs-MBP-2015 ~ % /Applications/NetBeans/Apache\ NetBeans\ 12.0.app/Contents/Resources/NetBeans/netbeans/bin/netbeans ; exit;
The operation couldn’t be completed. Unable to locate a Java Runtime that supports (null).
Please visit http://www.java.com for information on installing Java.

Cannot find java. Please use the --jdkhome switch.

Credit goes to How can I change Mac OS's default Java VM returned from /usr/libexec/java_home for providing the following step to determine what the JDK path is...

/usr/libexec/java_home -v '1.7*'

Then you can type the following (adjust for your path and version required)

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home"

However that didn't seem to do the trick for me (I also tried JDK_HOME), so instead from a Terminal window type the command to launch Netbeans but include the --jdkhome to your Java home folder, e.g.

/Applications/NetBeans/Apache\ NetBeans\ 12.0.app/Contents/Resources/NetBeans/netbeans/bin/netbeans --jdkhome /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home

Now I have Netbeans launching again. I'm not quite sure why the JAVA_HOME doesn't resolve this, but hopefully in the meantime anyone unable to launch Netbeans can at least use this workaround.

I've also found this How to run a shell script in OS X by double-clicking? useful to ensure I can double-click on the shell script to run it from a shortcut on my desktop.

🌐
Softonic
netbeans.en.softonic.com › home › mac › development & it
NetBeans for Mac - Download
May 30, 2025 - NetBeans for Mac, free and safe download. NetBeans latest version: Open source, high performance, modular, extensible, multi-platform Java IDE. NetBea
Rating: 7.5/10 ​ - ​ 54 votes
🌐
Javatpoint
javatpoint.com › how-to-install-netbeans-on-mac
How to Install NetBeans on Mac - javatpoint
How to Install NetBeans on Mac for beginners and professionals with different software installation in ubuntu such as Java, Python, Swift, Ruby, MySQL, MongoDB, CouchDB, Apache, Nginx, PhpMyAdmin, Eclipse, Netbeans, VIM, Wordpress, Drupal, CodeIgniter etc.
🌐
Wcupa
cs.wcupa.edu › rkline › index › netbeans-mac.html
NetBeans/JDK on MAC
$ /usr/libexec/java_home -V You'll get a listing of all installed JDKs; look for JDK 8 installations ("Java SE 8"). If you don't have one, then download a JDK 8 version and install it. Each JDK version should have an associated JDK home directory, which we'll assume the one corresponding to jdk1.8.0_8u202: /Library/Java/JavaVirtualMachines/jdk1.8.0_8u202.jdk/Contents/Home Then edit the following file (using nano): $ sudo nano /Applications/NetBeans/NetBeans\ 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf Scroll down the file, looking for the line: