4

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"
$
muru
  • 197,895
  • 55
  • 485
  • 740
Questioner
  • 6,839
  • 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... - https://askubuntu.com/questions/55848/how-do-i-install-oracle-java-jdk-7 –  Nov 26 '11 at 20:52
  • 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 03:45

4 Answers4

5

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: http://netbeans.org/downloads/index.html 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/netbeans-7.0.1-ml-linux.sh

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 netbeans-7.0.1-ml-linux.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 netbeans-7.0.1-ml-linux.sh  
  492  sudo apt-get install openjdk-6-jdk 
  493  sh netbeans-7.0.1-ml-linux.sh 
  494  history 
your_user@host_name:~/Downloads$ 

I hope this works for you...

This is the reference where i found the solution that worked for me: http://ubuntuforums.org/showthread.php?t=1873487&page=2

[Edit] Just in case, check the download checksum

$ md5sum netbeans-7.0.1-ml-linux.sh

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

$ md5sum netbeans-7.0.1-ml-linux.sh 
3559ec7d1ce1d4bcafd7eea98cc9c648  netbeans-7.0.1-ml-linux.sh
Manco1911
  • 171
  • 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 04: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 04: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 04:44
  • Great dave ! Im glad i could help. Happy Coding ! – Manco1911 Nov 27 '11 at 05:23
4

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/
1

I ran into this problem when I installed the openjdk-8-jdk-headless package instead of the openjdk-8-jdk package. The script wouldn't run, it just 'loads' for a few seconds and then nothing.

In this case, just remove the headless package using apt-get and install the other one. The headless package is meant for servers; it has the graphics component removed.

cst1992
  • 236
0

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:

#!/bin/bash
#Author: Yucca Nel http://thejarbar.org
#Will restart system
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
export PATH

#Modify these variables as needed...
tempWork=/tmp/work
defaultStartScript=/etc/init.d/rc.local
defaultNetBeansVer=7.1
locBin=/usr/local/bin

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
locStartScript=${locStartScript:-$defaultStartScript}

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


if [ ! -f $locStartScript ]
then
    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
fi
mkdir -p /$tempWork;
cd /$tempWork;

wget http://dlc.sun.com.edgesuite.net/netbeans/${netbeansVersion}/final/bundles/netbeans-${netbeansVersion}-ml-javase-linux.sh
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 ]
then
    sudo /sbin/umount /home/$HOME/NetBeansProjects
    sudo /sbin/mount.vboxsf NetBeansProjects $HOME/NetBeansProjects
fi

if mountpoint -q ~/NetBeansProjects
then
#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
then
    echo "sudo /sbin/mount.vboxsf NetBeansProjects $HOME/NetBeansProjects" | sudo tee -a $locStartScript
fi    
    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/netbeans-mount.sh
    echo "sudo /sbin/mount.vboxsf NetBeansProjects $HOME/NetBeansProjects" >> $tempWork/netbeans-mount.sh
    echo "mounted NetBeansProjects" >> $tempWork/netbeans-mount.sh
    echo "exit 0" >> $tempWork/netbeans-mount.sh

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

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

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

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

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

sudo reboot

exit 0
thejartender
  • 141
  • 7