When the NetBeans IDE cannot start a new project

Some hints and tips on how to overcome an annoying little gotcha that causes the Linux-based NetBeans IDE to freeze when trying to create a new project:

Instead of presenting the user with the options for creating a new project as shown in the screenshot below, the screen remains stuck with the egg timer, and does not allow the user to proceed:

Netbeans1

To get over this problem, I found this post particularly useful, and I will summarize its contents by way of the following steps:

1. Get the latest version of java

There’s no reason to stick with Java 6.x any more. Open up a command prompt and just use the following command to get the latest version (Java 7 at this time of writing)

$ sudo apt-get install openjdk-7-jre

2. Modify the JDK path in the netbeans.conf file

This command was quite useful in locating where in the netbeans installation folder the config file actually lived:

$ find netbeans-7.3.1/ -name *.conf

Open netbeans.conf in any text editor and make sure the default location of the JDK points to the latest version you have just installed. For demonstration purposes I’ve left the previous JDK location in and just commented it out.

# Default location of JDK:
# (set by installer or commented out if launcher should decide)
#
# It can be overridden on command line by using --jdkhome
# Be careful when changing jdkhome.
# There are two NetBeans launchers for Windows (32-bit and 64-bit) and
# installer points to one of those in the NetBeans application shortcut
# based on the Java version selected at installation time.
#
#netbeans_jdkhome="/usr/lib/jvm/java-6-openjdk-i386"
netbeans_jdkhome="/usr/lib/jvm/java-7-openjdk-i386"

And that’s all there was to it.

Netbeans now creates new C++ projects for me just fine.

Leave a Reply