Java is not working with netbeans IDE 7 on ubuntu 11.10

10,354

I use Netbeans 7.1 on Ubuntu 11.10 and it works great, I didn't need to specify anything extra to get the JDK working. Here is my update-alternatives:

Selection    Path                                      Priority   Status
 ------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode
* 1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode

How did you install Netbeans 7.1? As far as I remember it is not in the repositories. I used the GUI Swing installer from the Netbeans website. I installed it as a user not using sudo or su.

Also check how you run Netbeans, try going to NETBEANS/bin folder and running ./netbeans.

Share:
10,354
Vipin Kr. Singh
Author by

Vipin Kr. Singh

I am a freelance web designer and developer with 10+ years experience in web design and development My skills are: PHP, MYSQL, CakePHP, CodeIgniter, CSS, Jquery, Wordpress, Fireworks. Programming and design is my passion. I always keep an eye on the latest development of technologies related to my expertise areas and keep updated my skills to the latest releases.

Updated on June 04, 2022

Comments

  • Vipin Kr. Singh
    Vipin Kr. Singh almost 2 years

    I am using Netbeans IDE 7.1.1 on ubuntu 11.10, when I try to create JAVA project using File-> New Project-> JAVA Project-> JAVA Application, it shows me the following error:

    The JDK is missing an required to run some NetBeans modules. Please use the --jdkhome command line option to specify a JDK installation or see http://wiki.netbeans.org/FaqRunningOnJre for more information.

    So I used the following command

    sudo update-alternatives --config java
    

    and the result was:

        Selection    Path                                           Priority   Status
    ------------------------------------------------------------
        0            /usr/lib/jvm/java-6-openjdk/jre/bin/java        1061      auto mode
        1            /usr/lib/jvm/java-6-openjdk/jre/bin/java        1061      manual mode
      * 2            /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java   1051      manual mode
    

    I tried to run through terminal using the following command:

    netbeans --jdkhome /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java
    

    but I got error:

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

    and netbeans doesn't start as well.

    I tried this command using every path which I found through this command also:

    whereis java
    

    but every time I got the same error and netbeans doesn't start.

    in netbeans config file (/usr/local/netbeans-7.0/etc/netbeans.conf) jdkhome path is :

    netbeans_jdkhome="/usr/lib/jvm/java-7-openjdk-i386/jre"
    

    when I tried to run netbeans using this path through this command:

    netbeans --jdkhome /usr/lib/jvm/java-7-openjdk-i386/jre
    

    netbeans runs but when try to create project the same JDK missing error is displayed.

    One interesting thing also I encountered, if I use Eclipse every thing goes fine, I am able to create projects in eclipse and programs run smoothly. Eclipse doesn't show any wanning or errors like JDK is missing.