I can't start a new project on Netbeans

36,446

Solution 1

Just posted the same question here ... the solution for me was to downgrade OpenJDK from 6b27 to 6b24 (look at the link for details).

My NetBeans was looking excactly like in your sreenshot and also had some other strange problems.

I would suggest you do java -version if this shows that you have 6b27 installed and cat /var/log/dpkg.log | grep openjdk shows that you recently received the OpenJDK update you can try to fix the problem reverting to 6b24 using this command:

apt-get install openjdk-6-jre=6b24-1.11.1-4ubuntu2 openjdk-6-jre-headless=6b24-1.11.1-4ubuntu2 icedtea-6-jre-cacao=6b24-1.11.1-4ubuntu2

****edit****

As I discovered some other problems (SSH connection wouldn't establish within NetBeans) I finally took the step to upgrade to Oracle JDK7. To start NetBeans with another JDK you have got to edit ./netbeans-7.X/etc/netbeans.conf and change the line netbeans_jdkhome="/usr/lib/jvm/java-7-oracle/jre" (I guess this gets generated in the NetBeans installation process). Otherwise it will still use your old JDK no matter what java -version says.

Solution 2

It's a bug caused by the JDK version used:

This problem is JDK bug with focus (never ending loop when requesting focus). Issue filed against JDK is http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6598089. (IcedTea and in future OpenJDK will be distributed as default JDK for Linux distribution so it should be supported.)

The bug seems to affect both Oracle JDK and OpenJDK. Update your JDK in order to fix it. (Don't forget to chante the netbeans_jdkhome variable in the ./netbeans-7.X/etc/netbeans.conf file!)

Share:
36,446

Related videos on Youtube

That Brazilian Guy
Author by

That Brazilian Guy

Updated on September 18, 2022

Comments

  • That Brazilian Guy
    That Brazilian Guy almost 2 years

    The issue:

    When I open the "add new project" dialog (screenshot below), I can't create a new project. The loading message (hourglass icon) stays on forever. Except for "cancel", the other buttons are disabled.

    It was working fine a few days ago, I haven't changed any setting prior to the issue appearing. I ran the internal update feature, but the issue persists.

    enter image description here

    The info:

    My OS version: Ubuntu 12.04.2 LTS 64 bits

    Netbeans version:

    Help -> about

    Product Version: NetBeans IDE 7.2.1 (Build 201210100934)
    Java: 1.6.0_27; OpenJDK 64-Bit Server VM 20.0-b12
    System: Linux version 3.2.0-49-generic running on amd64; UTF-8; pt_BR (nb)
    User directory: /home/user/.netbeans/7.2.1
    Cache directory: /home/user/.cache/netbeans/7.2.1
    

    What I tried:

    • Changing the Look and Feel with the --laf command-line option. The look-and-feel does change, but the issue persists.
    • Using the internal update command, a plugin got updated but the issue persists.
    • Downloading and installing the latest version (7.31), it imported the settings from the previous version and the issue persists.
    • Removing the settings folder ~/.netbeans/7.3.1, restarting netbeans, choosing not to import settings and rather have a new clean install
  • That Brazilian Guy
    That Brazilian Guy almost 11 years
    Tried Nimbus, Metal, GTK, etc. The look and feel changes, but the unclickable buttons and eternal loading persists.
  • allquixotic
    allquixotic almost 11 years
    what version of Netbeans? anything on the console when you run netbeans from the console?
  • That Brazilian Guy
    That Brazilian Guy almost 11 years
    Nothing on the console if started from the command line.
  • mojo706
    mojo706 almost 11 years
    do you have any important projects prior to this lock up?
  • That Brazilian Guy
    That Brazilian Guy almost 11 years
    @mojo706 No, and the ones I had are backed-up
  • mojo706
    mojo706 almost 11 years
    try a reinstall then? Works most of the time.
  • That Brazilian Guy
    That Brazilian Guy almost 11 years
    I had to chmod +x the installer or it wouldn't even install the new version. That's not the cause of my issue.
  • That Brazilian Guy
    That Brazilian Guy almost 11 years
    @mojo706 As stated in the question, I did.
  • planty182
    planty182 almost 11 years
    @Ruda, the only other thing I did differently was installing netbeans prior to any other updates (ie I reinstalled ubuntu, and only installed the jdks (6 and 7) before installing netbeans). Other things to try: Run the installer with jdk7 and 6 and see if anything happens differently between them. Sorry my answer didn't help.
  • allquixotic
    allquixotic almost 11 years
    Good suggestion! You may also want to try Java 7, since JDK 7 and the OpenJDK equivalent have been released for quite a long time now, so there's really no reason to stick with Java 6.x.
  • s1lv3r
    s1lv3r almost 11 years
    @somequixotic I updated to it on my notebook, but for some reason the problems with NetBeans weren't gone. Perhaps it was still using OpenJDK under the hood? java -version showed java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
  • user180187
    user180187 almost 11 years
    ... forgot to mention, then either have to reinstall netbeans or update netbeans.conf to use new jre
  • That Brazilian Guy
    That Brazilian Guy almost 11 years
    Aha! dpkg.log shows upgrade openjdk-6-jre-lib 6b27-1.12.5-0ubuntu0.12.04.1 6b27-1.12.6-1ubuntu0.12.04.2 and two similar others on July 24th, one day before I left on a short vacation, nad Netbeans was working. Might be the culprit!
  • s1lv3r
    s1lv3r almost 11 years
    @ruda.almeida The downgrade solved the problem with the new projects for me, but later one I had other problems (with SSH), so the real final solution for me was to install openjdk-7-jre (or the oracle version - both work) and change the path in the netbeans.conf.
  • Andrews Kalinovski
    Andrews Kalinovski almost 11 years
    Just in case: For me works installing "sudo apt-get install openjdk-7-jre", but the with path in config file as: netbeans_jdkhome="/usr/lib/jvm/java-7-openjdk-amd64/jre", instead of the one you put in your answer
  • s1lv3r
    s1lv3r almost 11 years
    @gsc-leticia Jeah, that makes sense. The path in my question was for the oracle version and not for OpenJDK.
  • Andrews Kalinovski
    Andrews Kalinovski almost 11 years
    @s1lv3r sure, just for archive purpose :)
  • neo1691
    neo1691 almost 11 years
    I changed it to netbeans_jdkhome="/usr/lib/jvm/java-7-openjdk-amd64/jre" but now netbeans is not starting. The path is correct though. Any help?
  • s1lv3r
    s1lv3r almost 11 years
    @neo1691 Can you try starting it via the command line and see it it produces any output?
  • neo1691
    neo1691 almost 11 years
    I fixed it by installing the jdk. Only jre was present
  • That Brazilian Guy
    That Brazilian Guy over 10 years
    This answer is incomplete as it stands, It will only work if you already have Java 7 installed, if you are using openJDK, if your processor architecture is amd64, etc.
  • Mikhail
    Mikhail over 10 years
    I had same problem solved with this answer but also I had to remove /home/username/.netbeans directory with old user settings. Because after moving to newer java version netbeans tried to start but suddenly closed at startup. Removing old settings alows netbeans to recreate them and all is working fine.
  • Pilot6
    Pilot6 about 8 years
    It looks like a valid answer to me.