It’s been a while since I last wrote a non-trivial amount of Java and I can’t say I miss it. However, I want to work on a plugin for Jenkins which means diving back in. Netbeans was my IDE of choice when I last worked with Java but unfortunately Netbeans is not packaged for Fedora (presumably due to it’s use of Oracle’s JDK rather than OpenJDK?). As such, if you want to avoid using Eclipse then you need to install Netbeans “by hand”. There are a couple of tricks to doing this correctly.
We’re going to use OpenJDK rather than Oracle JDK as the former is packaged in Fedora.
$ sudo dnf install java-1.8.0-openjdk.x86_64
Download the latest installer from the Netbeans website. At the time of writing, this was Netbeans 8.2.
Enable root access to X
I wanted Netbeans installed in a standard location (
/usr/local) rather than
in my home directory. Unfortunately this requires root privileges and and
running the installer under
sudo produces errors. The Arch
wiki provides a
number of suggestions for how to do this, but the one that worked for me was to
temporarily allow root access to X like so:
$ xhost +
Run the installer
The only change you will need to make is to change the JDK path from
wherever OpenJDK is installed
/usr/lib/jvm/java-1.8.0-openjdk-220.127.116.11-3.b16.fc25.x86_64 for me). If you
don’t do this, you will get a warning stating “The JDK is missing”. If this
happens, follow the instructions provided here to resolve the issue
Disable root access to X
Once installation is complete, we can disable root access to prevent anyone else accessing our X session.
$ xhost -
NetBeans should now be installed.