NetBeans 10 on macOS

At the moment, you can’t get nice looking, full-blown installer of NetBeans for macOS, yet. However, running it is fairly easy. Just make sure you have recent JDK installed – just get it from here: JDK 11

Note! Please, make sure you can survive with new licensing model preparred by Oracle. It’s quite different comparing to what it was in the past: Java SE license. It might be more suitable for you to stick to GPL based version of JDK: OpenJDK.

I, personally, decided to use Open JDK. Just download tar.gz, put it inside ~/opt and make sure to export system variables

> mkdir ~/opt
> cd ~/opt
> curl -O https://download.java.net/java/ga/jdk11/openjdk-11_osx-x64_bin.tar.gz
> tar zxf openjdk-11_osx-x64_bin.tar.gz
> export JAVA_HOME=$HOME/opt/jdk-11.jdk/Contents/Home/
> export PATH=${JAVA_HOME}/bin:${PATH}
> java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

# If you want to make sure OpenJDK is visible system wide, make sure
# to copy whole structure here

> cd /Library/Java/JavaVirtualMachines/
> sudo cp -r ~/opt/jdk-11.jdk .

# you can also modify your ~/.profile and add following line there
# export JAVA_HOME=$(/usr/libexec/java_home -v 11)

once you have done it, make sure to download NetBeans nightly build. You can find it here: (all files in zip).

You will get huge zip file and inside, you will have something like this

archive
`-- nbbuild
    |-- build
    |-- nbms
    |   |-- apisupport
    |   |-- ergonomics
    |   |-- extide
    |   |-- groovy
    |   |-- harness
    |   |-- ide
    |   |-- java
    |   |-- javafx
    |   |-- licenses
    |   |-- nb
    |   |-- php
    |   |-- platform
    |   |-- profiler
    |   |-- webcommon
    |   `-- websvccommon
    `-- netbeans
        |-- apisupport
        |-- bin
        |-- cnd
        |-- cndext
        |-- dlight
        |-- ergonomics
        |-- etc
        |-- extide
        |-- groovy
        |-- harness
        |-- ide
        |-- java
        |-- javafx
        |-- licenses
        |-- nb
        |-- php
        |-- platform
        |-- profiler
        |-- webcommon
        `-- websvccommon

you are interested in this location

> cd archive/nbbuild/netbeans/bin

# make sure to use version you really want to use
> ./netbeans --jdkhome ${JAVA_HOME}

and, that’s it :) You can start working with NetBeans 10.

Comments (5)

e8b23bb21aa0fbced360d1a5093e1a06October 14th, 2018 at 2:39 pm

Just sharing :) on how I install netbeans 10, I am using their default follow this https://github.com/carljmosca/netbeans-macos-bundle steps.

Open install.sh find and replace:

NETBEANS_VERSION=${NETBEANS_VERSION:-9}
NETBEANS_URI=${NETBEANS_URI:-http://apache.mirrors.pair.com/incubator/netbeans/incubating-netbeans/incubating-9.0/incubating-netbeans-9.0-bin.zip}

With

NETBEANS_VERSION=${NETBEANS_VERSION:-10}
NETBEANS_URI=${NETBEANS_URI:-http://apache.mirrors.pair.com/incubator/netbeans/incubating-netbeans/incubating-10.0-vc1/incubating-netbeans-10.0-vc1-bin.zip}

Terminal: ./install.sh

Thats it.

michalOctober 14th, 2018 at 6:40 pm

Thanks for your comment!

I guess, for people who are not familiar with CLI, this kind of installer is way easier to use.

5aee84ab615485a26e99c24a76e8c707October 15th, 2018 at 4:25 pm

If you install Java directly into /Library/Java/JavaVirtualMachines, macOS will detect it and automatically use the latest one installed there. There’s no need to explicitly add any of the Java executables to your path because macOS manages this for you. You can always get the path of the Java that macOS would normally use with this command:

/usr/libexec/java_home

If you want to get the path for a specific version of Java installed there, use this:

/usr/libexec/java_home -v 10

For Java versions 8 and prior, use this format instead:

/usr/libexec/java_home -v 1.8

The latter commands are useful for setting up scripts that need to run with a specific version of Java.

1f8de75866b5b9edf6052422e7e11039October 15th, 2018 at 4:27 pm

If you install Java directly into /Library/Java/JavaVirtualMachines, macOS will detect it and automatically use the latest/best one installed there. There’s no need to explicitly add any of the Java executables to your path because macOS manages this for you. You can always get the path of the Java that macOS would normally use with this command:

/usr/libexec/java_home

If you want to get the path for a specific version of Java installed there, use this:

/usr/libexec/java_home -v 10

For Java versions 8 and prior, use this format instead:

/usr/libexec/java_home -v 1.8

The latter commands are useful for setting up scripts that need to run with a specific version of Java.

michalOctober 15th, 2018 at 6:42 pm

Yes, sure. Putting things directly into /Library/Java/JavaVirtualMachines makes it easier to maintain the releases (e.g. you can use /usr/libexec/java_home). However, sometimes, it’s better to test most recent release “outside” this location – especially when you are not sure whether it will work fine. Anyway, there is a step (in the post) showing how to put JDK inside system directory.