How do I install Netbeans?

NetBeans' Integrated Development Environment (IDE) is available in Ubuntu's Universe/Java section. Following are the steps to install from the repository: Scroll down for steps to install the latest version of the IDE.

  1. If Universe repository in not allowed, allow it and update:

    sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
    sudo apt-get update
    
  2. Install NetBeans with:

    sudo apt-get install netbeans
    

Useful terminal shortcut: Ctrl+Shift+V can be used to paste copied text to terminal.

The NetBeans IDE - Shapshots:

The IDE's startpage: snap1

A sample project: snap2


Downloading and Installing the latest available version:

You can download the installation files and get help with installation, troubleshooting and others at NetBeans' official website. (The contents below have been adopted from the same.)

Downloading the software:

  1. Go to https://netbeans.org/downloads/
  2. In the upper right area of the page, select the language and platform (Linux (x86/x64)) from the drop-down list.
  3. Click the Download button for the download option that you want to install. download_sh

  4. Save the installer file to your system. save_installer

To install the software:

  1. After the download completes, run the installer script with .sh extension. You might need to make the installer files executable by using the following command: chmod +x <installer-file-name> (e.g. chmod +x netbeans-7.4-javaee-linux.sh)

  2. If you downloaded the All or Java EE bundle, you can customize your installation. Perform the following steps at the Welcome page of the installation wizard:

    • Click Customize;
    • In the Customize Installation dialog box, make your selections;
    • Click OK;
  3. At the Welcome page of the installation wizard, click Next.

  4. At the License agreement page, review the license agreement, click the acceptance check box, and click Next.

  5. At the JUnit License Agreement page, decide if you want to install JUnit and click the appropriate option, click Next.

  6. At the NetBeans IDE installation page, do the following:

    • Accept the default installation directory for the NetBeans IDE or specify another directory.

      Note: The installation directory must be empty and the user profile you are using to run the installer must have read/write permissions for this directory.

    • Accept the default JDK installation to use with the NetBeans IDE or select a different installation from the drop-down list. If the installation wizard did not find a compatible JDK installation to use with the NetBeans IDE, your JDK is not installed in the default location. In this case, specify the path to an installed JDK and click Next, or cancel the current installation. After installing the required JDK version you can restart the installation.

      Note: If the JDK version is older than the recommended JDK 7 Update 10, download and install the latest JDK update from Java SE Downloads page and restart the NetBeans IDE installer.

  7. If the GlassFish Server Open Source Edition 4.0 installation page opens, accept the default installation directory or specify another installation location.

  8. If you are installing Apache Tomcat, on its installation page, accept the default installation directory or specify another installation location. Click Next.

  9. At the Summary page, do the following:

    • Verify that the list of components to be installed is correct.
    • Select the Check for Updates check box if you want to check the Update Center for possible updates and have the JUnit library installed during the installation (provided you accepted the license in step 5.)
    • Verify that you have adequate space on your system for the installation.
  10. Click Install to begin the installation.

  11. At the Setup Complete page, provide anonymous usage data if desired, and click Finish.

    Note: If you encounter problems successfully completing the software installation, see Troubleshooting for descriptions and suggested workarounds for unresolved issues that could affect the installation process.


Uninstallation:

To uninstall the IDE:

  1. Shut down the IDE.
  2. In the IDE installation directory, run the uninstall.sh file.
  3. To uninstall GlassFish and Tomcat together with the IDE, at the Summary page make sure that the correct versions are listed and check the appropriate checkboxes.
  4. At the Summary page, click Uninstall.
  5. After uninstallation completes, click Finish.

Simply install it with the official installer.
(The example below uses the most recent Java SE version ...)

  1. Make the installer executable with chmod u+x netbeans-7.0.1-ml-javase-linux.sh
  2. Run the installer: ./netbeans-7.0.1-ml-javase-linux.sh
  3. Install it somewhere, like /home/username/Documents/NetBeans

This way, you can have an always-up-to-date Netbeans on your PC. Much more convenient than the official repository or a PPA.

ps.: This is not a direct answer to your question, but a different solution for the situation.


NetBeans IDE 7.4 works better and faster with JDK distribution, so first download the oracle’s Co-bundled package JDK 7u51 with NetBeans 7.4. Go and download:

  1. Download:

    jdk-7u51-nb-7_4-linux-i586.sh for the 32-bit Linux System.

    jdk-7u51-nb-7_4-linux-x64.sh for the 64-bit Linux System.

  2. Open a terminal and change directory where file is (~/Downloads in my case)

    cd ~/Downloads
    
  3. Set execution privileges:

    chmod +x jdk-7u51-nb-7_4-linux-x64.sh
    
  4. Now run the installer using the command:

    ./jdk-7u51-nb-7_4-linux-x64.sh
    

It will bring up the install wizard and you can follow the on-screen prompts to install the software.