dotlinux blog

How to Install NetBeans IDE in CentOS, RHEL and Fedora

Apache NetBeans is a powerful, open-source Integrated Development Environment (IDE) that provides a comprehensive set of tools for software development. It's a favorite among Java developers but also offers excellent support for other languages like PHP, C/C++, and HTML5. Whether you're building enterprise-scale applications, web services, or simple desktop programs, NetBeans offers an intuitive interface coupled with robust features like intelligent code completion, powerful debugging, and seamless integration with version control systems like Git.

For developers working on CentOS, Red Hat Enterprise Linux (RHEL), or Fedora, having a reliable IDE is crucial for productivity. This guide will walk you through several methods to install NetBeans IDE on your system, ensuring you can get started with your development projects quickly and efficiently. We'll cover installation via the official installer, using the Snap package, and leveraging the SDKMAN tool manager.


2026-05

Table of Contents#

  1. Prerequisites
  2. Method 1: Installing NetBeans using the Official Installer
  3. Method 2: Installing NetBeans using Snap (Recommended for Fedora)
  4. Method 3: Installing NetBeans using SDKMAN
  5. Verifying the Installation
  6. Troubleshooting Common Issues
  7. Conclusion
  8. References

Prerequisites#

Before you begin the installation, ensure your system meets the following requirements:

  • A CentOS, RHEL, or Fedora System: This guide is tailored for these distributions. The commands might slightly differ between versions (e.g., using dnf for newer Fedora/RHEL/CentOS vs. yum for older ones).
  • Java Development Kit (JDK): NetBeans requires a JDK to be installed. NetBeans 13 and later require JDK 11 or above. It's recommended to install JDK 17 (LTS) or the latest JDK.
    • To check if Java is installed, run: java -version
    • If not installed, you can install OpenJDK using your package manager:
      • For Fedora/RHEL/CentOS 8/9:
        sudo dnf install java-17-openjdk-devel
      • For CentOS 7:
        sudo yum install java-17-openjdk-devel
  • Superuser (sudo) Privileges: You will need sudo access to install packages and copy files to system directories.
  • A Graphical Desktop Environment (for Methods 1 & 2): The standard installer and Snap method require a GUI. If you are on a server without a GUI, see the troubleshooting section for Method 1.

Method 1: Installing NetBeans using the Official Installer#

This is the most direct method and gives you full control over the installation path and components.

Step 1: Download the NetBeans Installer#

  1. Visit the official Apache NetBeans download page.
  2. Select the version you want to install. For most users, the "Apache NetBeans" binary release is the correct choice. Choose the installer that matches your system architecture (e.g., linux-x64.sh for 64-bit Linux).
  3. You can download it directly from the browser or use the wget command in the terminal. Replace the URL with the one for the latest version.
    wget https://archive.apache.org/dist/netbeans/netbeans/18/apache-netbeans-18-bin-linux-x64.sh

Step 2: Make the Installer Script Executable#

The downloaded file is a shell script. You need to grant it execute permissions before running it.

chmod +x apache-netbeans-18-bin-linux-x64.sh

Step 3: Run the Installer#

Execute the script. It's highly recommended to run it as a regular user, not as root. The installer will ask for your sudo password only if you choose to create desktop shortcuts.

./apache-netbeans-18-bin-linux-x64.sh

A graphical installation wizard will open. Follow these steps:

  1. Welcome Screen: Click "Next".
  2. License Agreement: Read the agreement, select "I accept the terms...," and click "Next".
  3. Choose Install Location: Select the folder where you want NetBeans to be installed. The default (/home/yourusername/netbeans-18/) is usually fine. Click "Next".
  4. Check for Updates: It's a good practice to leave "Check for Updates" enabled. Click "Next".
  5. Summary: Review your choices and click "Install".
  6. The installation progress bar will show the files being copied.
  7. Setup Complete: You can choose to contribute to usage statistics. Click "Finish".

Step 4: Launch NetBeans IDE#

After installation, you can launch NetBeans in several ways:

  • Terminal: Navigate to the installation directory and run the bin/netbeans script.
    ~/netbeans-18/bin/netbeans
  • Desktop Shortcut: If you allowed the installer to create shortcuts, you can find NetBeans in your application menu (under "Programming" or "Development").
  • Create a Launcher (Optional): To make it easier to launch from anywhere, you can create a symbolic link in a directory that's in your PATH, like ~/bin (ensure ~/bin is in your PATH).
    mkdir -p ~/bin
    ln -s ~/netbeans-18/bin/netbeans ~/bin/netbeans
    # Now you can simply type `netbeans` in the terminal to start the IDE.

Snap is a universal package manager that simplifies installation and provides automatic updates. This method is particularly easy on Fedora, where Snap is readily available.

  1. Install Snapd (if not already installed):

    • On Fedora:
      sudo dnf install snapd
    • On RHEL/CentOS: You need to enable the EPEL repository first.
      sudo dnf install epel-release  # For RHEL/CentOS 8/9
      sudo dnf install snapd         # Or use 'yum' for CentOS 7
    • After installing snapd, enable the socket for the snap communication interface:
      sudo systemctl enable --now snapd.socket
  2. Install the NetBeans Snap:

    sudo snap install netbeans --classic

    The --classic flag is required because NetBeans needs full access to the system, similar to a traditionally packaged application.

  3. Launch NetBeans: You can now launch NetBeans from the application menu or by typing netbeans in the terminal.

Method 3: Installing NetBeans using SDKMAN#

SDKMAN! (Software Development Kit Manager) is a tool for managing parallel versions of multiple SDKs, including NetBeans. This is an excellent choice if you already use SDKMAN for Java versions.

  1. Install SDKMAN (if not installed):

    curl -s "https://get.sdkman.io" | bash
    source "$HOME/.sdkman/bin/sdkman-init.sh"
  2. Install NetBeans using SDKMAN:

    sdk install netbeans
  3. Follow the Prompts: SDKMAN will list available versions. Select the one you want to install.

  4. Launch NetBeans: Once installed, you can launch it with netbeans from the terminal. SDKMAN automatically manages the PATH for you.

Verifying the Installation#

Regardless of the method you used, you can verify that NetBeans is installed correctly by launching it. Upon first start, it will prompt you to set the default JDK (if it detects multiple ones). The main window should open without any errors.

Troubleshooting Common Issues#

Java Not Found#

  • Symptom: The installer fails to start or NetBeans fails to launch, with an error about Java not being found.
  • Solution: Ensure the JDK is installed correctly. Set the JAVA_HOME environment variable. Add the following lines to your ~/.bashrc or ~/.zshrc file (adjust the path to your JDK):
    export JAVA_HOME=/usr/lib/jvm/java-17-openjdk  # Path may vary
    export PATH=$JAVA_HOME/bin:$PATH
    Then, run source ~/.bashrc to apply the changes.

Graphical Installer Issues on Headless Servers#

  • Symptom: You are on a server without a GUI and the installer fails because it cannot display the graphical interface.
  • Solution: Use the --silent installer option. You must know the path where you want to install it and the JDK beforehand.
    ./apache-netbeans-18-bin-linux-x64.sh --silent --javahome /path/to/your/jdk

Snap Command Not Found#

  • Symptom: The snap command is not recognized.
  • Solution: Ensure snapd is installed correctly and that you have logged out and back in after installation, or started a new terminal session. On RHEL/CentOS, double-check that the EPEL repository is enabled.

Conclusion#

You have now successfully installed Apache NetBeans IDE on your CentOS, RHEL, or Fedora system. You explored three different methods: the official installer for maximum control, the Snap package for simplicity and automatic updates, and SDKMAN for those who already manage their development tools with it.

NetBeans is a versatile IDE ready to boost your development workflow. You can start by creating a new project (File > New Project) and exploring its rich set of features. Happy coding!

References#

  1. Apache NetBeans Official Website
  2. Apache NetBeans Download Page
  3. Snapcraft Official Website
  4. SDKMAN! Official Website
  5. OpenJDK Installation Guide for Linux