Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed Netbeans 7.0.1, and I've made sure to install all the JDKs and JREs I could find. It installed without errors. I also saw this question and made sure I followed all the instructions there as well.

I never got any error messages of any kind. So far as I know, it installed okay.

However, when I try to run Netbeans, I get no response. If I run it from the command line, after about 30 seconds, the prompt just comes back. There's no error message of any kind to let me know what's wrong.

$ /bin/sh "/home/dave/netbeans-7.0.1/bin/netbeans"

What's the issue, and how do I get Netbeans to run?

New command line output as a result of following instructions offered in an answer:

$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  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-6-sun/jre/bin/java       63        manual mode

Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/java-6-sun/jre/bin/java to provide /usr/bin/java (java) in manual mode.
$ /bin/sh "/home/dave/netbeans-7.0.1/bin/netbeans"
share|improve this question
up vote 5 down vote accepted

ok, dave, since you posted as a search term ubuntu 11.10.. ill assume you are running Ubuntu 11.10.. :D

I am running also the same version, fully updated today, the version im running is 64-bits, but that shouldn't make the difference.

This is what i did to install netbeans 7.0.1 on my box:

1) Download Netbeans from their website: choose freely the version you need. (dont try to install it yet)

2) Install from the repos the openjdk 6: sudo apt-get install openjdk-6-jdk

3) run the netbeans installer you downloaded previously:

 $ sh /path_to_downloaded_file/

or if you want to make it easier for the eye, "cd" to the place where you saved the download, (usually the Downloads folder) and :

$ sh

The installer should launch and check for the JDK, it also shouldn't say anything about the JDK (it displays a warning message only if it doesn't finds it).

Now you should be able to follow the installer without any problems.

I just downloaded and installed the full version without issues following this steps:

  488  clear
  489  cd Downloads/
  490  ls
  491  sh  
  492  sudo apt-get install openjdk-6-jdk 
  493  sh 
  494  history 

I hope this works for you...

This is the reference where i found the solution that worked for me:

[Edit] Just in case, check the download checksum

$ md5sum

It should return that it sais on the download page says, in my case thisis the output for the 204mb download:

$ md5sum 
share|improve this answer
Thank you for responding. Yes, I am on 11.10, and my system is 64 bit. I followed your instructions as exactly as I could, but it did not change anything. – Questioner Nov 27 '11 at 4:31
Dave, no problem, just trying to help. Please try to uninstall the actual netbeans you have installed and download it again. Did you also checked the checksum of the downloaded file (just in case its a bad download) ? – Manco1911 Nov 27 '11 at 4:34
Yes, redownloading it worked! I can only guess that between last time I downloaded it and this time, my Java settings changed as per the instructions here. In other words, one needs to have the right Java set up from the start - changing it after having installed Netbeans won't cut it. Thank you for the help! – Questioner Nov 27 '11 at 4:44
Great dave ! Im glad i could help. Happy Coding ! – Manco1911 Nov 27 '11 at 5:23

This is quite old now but I just ran into the same problem with Ubuntu 13.04 and Netbeans 7.3.1

The reason for this is because when Netbeans is run with root privilleges to install all plugins it creates ~/.cache/netbeans/7.3.1/* with root permissions and doesn't clear those files when exiting. When you run it with your user, it's denied access to those files thus Netbeans terminates without a warning.

Changing ownership of that folder fixes the issue:

sudo chown yourUser -R ~/.cache/netbeans/
sudo chgrp yourUser -R ~/.cache/netbeans/
share|improve this answer
This one worked for me! – Luis Lobo Borobia Aug 8 '13 at 23:06
the correct answer without having to reinstall! – epoch Jun 13 at 14:02

Which Java/Ubuntu you are using? To guess, I think what you need is the Sun/Oracle Java and not OpenJDK. Since Ubuntu 10.04 LTS, Sun Java (now Oracle) was removed from the Multiverse section of the software repositories; so you have most likely installed OpenJDK. To install the right Java for lucid...

share|improve this answer
Thank you for answering. I followed your directions, but in the end, Netbeans still doesn't run. Please see the command line output I've added to my original question. – Questioner Nov 27 '11 at 3:45

I wrote a install script for NetBeans aimed at users running a dual system with VirtualBox. After running this script you will be able to launch netbeans from the terminal and if you are running it as a guest system on VirtualBox, be able to mount the from host to guest with means of scripts that are built in your /usr/local/bin directory:

#Author: Yucca Nel
#Will restart system
export PATH

#Modify these variables as needed...

read -p "Please [Enter] full path name of your local startup script ($defaultStartScript is the default). Please
make sure on this before providing a value by consulting documentation for your system:" locStartScript

read -p "Please [Enter] NetBeans Version ($defaultNetBeansVer is default):" netbeansVersion

if [ ! -f $locStartScript ]
    echo "The file you provided could not be found. Remember to include the full path and try again. Exiting in 7 secs..."
    sleep 7
    exit 1
mkdir -p /$tempWork;
cd /$tempWork;

sh $tempWork/*sh;

#Add Netbeans launcher to your PATH. Doing so allows you to run 'netbeans' command from the terminal
#This line will need to be changed if you changed the default install location (IOW Netbeans is not in ~/)
sudo ln -f -s ~/netbeans-7.1/bin/netbeans /usr/bin/;

#If you use VirtualBox , you can share your projects between Host and guest. Name of shared
#folder must match 'NetBeansProjects'
mkdir -p $HOME/NetBeansProjects

if [ -f /sbin/mount.vboxsf ]
    sudo /sbin/umount /home/$HOME/NetBeansProjects
    sudo /sbin/mount.vboxsf NetBeansProjects $HOME/NetBeansProjects

if mountpoint -q ~/NetBeansProjects
#Add it to the start script to automate process...
    sudo sed -ie '$d' $locStartScript 
if ! grep "sudo /sbin/mount.vboxsf NetBeansProjects $HOME/NetBeansProjects" /etc/init.d/rc.local
    echo "sudo /sbin/mount.vboxsf NetBeansProjects $HOME/NetBeansProjects" | sudo tee -a $locStartScript
    echo "exit 0" | sudo tee -a $locStartScript
    sudo chmod +x $locStartScript

#Create a mount and unmount script file...
    rm -rf $tempWork/*
    echo '#!/bin/bash' > $tempWork/
    echo "sudo /sbin/mount.vboxsf NetBeansProjects $HOME/NetBeansProjects" >> $tempWork/
    echo "mounted NetBeansProjects" >> $tempWork/
    echo "exit 0" >> $tempWork/

    echo '#!/bin/bash' > $tempWork/
    echo "sudo umount $HOME/NetBeansProjects" >> $tempWork/netbeans-umount.
    echo "unmounted NetBeansProjects" >> $tempWork/
    echo 'exit 0' >> $tempWork/

#Script for mounting ALL VirtualBox shared solders....
#If there isn't one create one...
if [ ! -f $locBin/ ]
    echo '#!/bin/bash' > $tempWork/
    echo "sudo /sbin/mount.vboxsf NetBeansProjects $HOME/NetBeansProjects" | sudo tee -a $tempWork/
    echo "exit 0" | sudo tee -a $tempWork/

#Otherwise if there is one, but no mount, add one...
elif ! grep "sudo /sbin/mount.vboxsf NetBeansProjects" $locBin/
    sudo sed -ie '$d' $locBin/
    echo "sudo /sbin/mount.vboxsf NetBeansProjects $HOME/NetBeansProjects" | sudo tee -a $locBin/
    echo "exit 0" | sudo tee -a $locBin/

#Script for unmounting ALL VirtualBox shared folders...
#If there isn't one create one...
if [ ! -f $locBin/ ]
    echo '#!/bin/bash' > $tempWork/
    echo "sudo umount -a -t vboxsf" | sudo tee -a $tempWork/
    echo "echo 'unmounted all VirtualBox shared folders'" | sudo tee -a $tempWork/
    echo "exit 0" | sudo tee -a $tempWork/

    sudo chmod +x $tempWork/*
    sudo mv -f $tempWork/*.sh $locBin/
    rm -rf $tempWork

sudo reboot

exit 0
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.