Website Vidya
Cloud & DevOpsStep-by-Step Guide

How to Install NetBeans on Ubuntu 24.04

Step-by-step tutorial on how to install NetBeans on Ubuntu 24.04 LTS. Setup Apache NetBeans with OpenJDK 21 Java runtime, Snap, and desktop launcher.

RR
Rajesh RayLead Systems Educator
Published:
7 min read
PDF Cheat Sheet
How to Install NetBeans on Ubuntu 24.04
AI Executive SummaryWebsiteVidya AI

7 min read

Step-by-step tutorial on how to install NetBeans on Ubuntu 24.04 LTS. Setup Apache NetBeans with OpenJDK 21 Java runtime, Snap, and desktop launcher.

Key Highlights
  • Prerequisites and Supported Releases
  • Step 1: Updating System Repositories and Installing OpenJDK Java Runtime
  • Step 2: Installing Apache NetBeans via Official Snap (Recommended)
Grounded in full engineering runbookWebsiteVidya AI Engine

Apache NetBeans is a renowned, open-source integrated development environment engineered to provide comprehensive tooling for Java SE, Java EE (Jakarta EE), PHP, HTML5, JavaScript, and C/C++ applications. Celebrated for its intuitive user interface, out-of-the-box Maven and Gradle support, advanced code refactoring analyzers, and visual GUI designer (Project Matisse), NetBeans delivers a robust development environment without requiring the extensive plugin setup often needed by competing editors.

Deploying NetBeans on Ubuntu 24.04 LTS pairs an enterprise-grade Linux desktop operating system with a mature development toolchain backed by the Apache Software Foundation. Learning how to install netbeans on ubuntu 24.04 gives Java and polyglot developers access to modern language features, seamless profiling tools, and robust version control integration.

In this comprehensive step-by-step tutorial, we demonstrate how to install Apache NetBeans on Ubuntu 24.04 LTS (Noble Numbat). We cover installing OpenJDK 21 (the long-term support Java runtime), installing NetBeans via the official classic Snap package, performing an alternative manual binary installation into /opt/netbeans, configuring the Java runtime environment in netbeans.conf, and generating a GNOME desktop launcher.

Advertisement

Prerequisites and Supported Releases

This guide is thoroughly verified on Ubuntu 24.04 LTS (Noble Numbat). The instructions apply cleanly to cloud instances (AWS EC2, Google Compute Engine, DigitalOcean, Hetzner), bare-metal servers, and local virtual machines.

Before proceeding, ensure you have the following requirements satisfied:

  • A desktop workstation running Ubuntu 24.04 LTS.
  • A standard user account with administrative sudo privileges.
  • At least 4 GB of RAM (8 GB recommended for enterprise Java, Maven, and Gradle multi-module projects).
  • An active internet connection to download Java runtime packages and IDE dependencies.

Step 1: Updating System Repositories and Installing OpenJDK Java Runtime

Apache NetBeans requires a Java Development Kit (JDK 17 or JDK 21 LTS) to execute the IDE runtime and compile Java applications. Ubuntu 24.04 includes OpenJDK 21 as its default long-term support Java platform.

First, update your local APT repository index to ensure you have the latest package listings.

Advertisement

Install OpenJDK 21 using the default-jdk package, which installs both the Java Runtime Environment (JRE) and compiler tools (javac).

Verify that the Java compiler and runtime are correctly installed and available on your system path.

# Update APT package repositories
sudo apt update && sudo apt upgrade -y

# Install OpenJDK 21 default Java development kit
sudo apt install -y default-jdk

# Verify Java runtime and compiler versions
java -version
javac -version

The most straightforward, reliable method to install and maintain Apache NetBeans on Ubuntu 24.04 is through the official Snap package maintained by the Apache NetBeans community.

The Snap package delivers an up-to-date, self-contained release that updates automatically and creates system desktop launchers without manual configuration.

Advertisement

Install NetBeans using the snap command with the --classic confinement flag to grant the IDE access to your local filesystem and build tools.

Once the installation completes, verify the installed package version.

# Install Apache NetBeans via classic Snap confinement
sudo snap install netbeans --classic

# Verify snap installation and version
snap list netbeans

Step 3: Alternative Method: Installing Apache NetBeans via Official Binary Release

If you prefer not to use Snap packages or require complete control over installation paths and configuration files, you can install NetBeans directly from the official Apache Software Foundation binary release archive.

Download the official NetBeans binary zip archive into your /tmp directory using wget.

Extract the archive into the /opt/ system directory, which is the standard Linux location for third-party standalone applications.

Create a system-wide symbolic link so that all users can launch NetBeans directly from the command line.

# Install unzip utility if not already installed
sudo apt install -y unzip wget

# Download official Apache NetBeans binary release
cd /tmp
wget https://dlcdn.apache.org/netbeans/netbeans-installers/24/apache-netbeans-24-bin.zip -O netbeans.zip

# Extract archive into /opt/
sudo unzip -q netbeans.zip -d /opt/

# Create symbolic link in system bin path
sudo ln -sf /opt/netbeans/bin/netbeans /usr/local/bin/netbeans

# Clean up downloaded zip archive
rm -f /tmp/netbeans.zip

Step 4: Configuring the JDK Home in netbeans.conf

When using the standalone binary installation, NetBeans searches for an active Java installation on your system path. To guarantee stability and avoid runtime conflicts when multiple Java versions are installed, explicitly specify your JDK directory in the NetBeans configuration file.

Open the configuration file at /opt/netbeans/etc/netbeans.conf with administrative privileges.

Locate the parameter netbeans_jdkhome and set it to your OpenJDK 21 installation path (typically /usr/lib/jvm/java-21-openjdk-amd64).

Save and close the file.

# Locate active OpenJDK installation path
readlink -f $(which java) | sed 's:/bin/java::'

# Edit /opt/netbeans/etc/netbeans.conf to specify JDK home
# sudo nano /opt/netbeans/etc/netbeans.conf

# Ensure the following line is active:
# netbeans_jdkhome="/usr/lib/jvm/java-21-openjdk-amd64"

Step 5: Creating a GNOME Desktop Launcher for Standalone NetBeans

If you performed the manual binary installation in Step 3, you must create a .desktop entry so that NetBeans appears in your Ubuntu GNOME Application menu, dock, and dashboard search.

Create a desktop file named netbeans.desktop inside /usr/share/applications/.

Define the application metadata, execution path (/opt/netbeans/bin/netbeans), and icon path (/opt/netbeans/nb/netbeans.png).

Update the desktop application database to make the launcher immediately visible in your desktop environment.

# Create desktop launcher configuration
sudo bash -c 'cat <<EOF > /usr/share/applications/netbeans.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=Apache NetBeans
Comment=Apache NetBeans Integrated Development Environment
Exec=/opt/netbeans/bin/netbeans
Icon=/opt/netbeans/nb/netbeans.png
Categories=Development;IDE;Java;
Terminal=false
StartupNotify=true
EOF'

# Refresh desktop database
sudo update-desktop-database

Step 6: Launching Apache NetBeans and Initializing Settings

You can launch Apache NetBeans either by clicking its icon in the Ubuntu Applications grid or by running netbeans in your terminal.

Upon first startup, NetBeans prompts you to import settings from previous versions if detected.

The Start Page provides quick access to recent projects, online tutorials, sample repositories, and plugin updates.

Verify that the IDE detects your installed Java runtime by checking the bottom status bar and exploring the Options menu.

# Launch NetBeans from terminal in background
netbeans &

# Verify running NetBeans process
pgrep -l netbeans

Step 7: Configuring Build Tools and Plugins in NetBeans

Apache NetBeans includes native support for Apache Maven and Gradle build automation systems. For projects that rely on system-installed build tools, configure the respective executable paths.

Navigate to Tools > Options > Java > Maven to customize local repository locations and global settings files.

To enable support for additional programming languages such as PHP, C/C++, or Python, open the Plugin Manager via Tools > Plugins.

Switch to the Available Plugins tab, select your desired language packs or productivity tools, and click Install.

# Optional: Install Maven and Git from APT repositories
sudo apt install -y maven git

# Verify Maven installation
mvn -version

Step 8: Creating Your First Java Application in NetBeans

To verify that your NetBeans installation and Java compilation environment are fully operational, create a simple Java application.

Click File > New Project from the top navigation bar.

Under Categories, select Java with Maven, choose Java Application, and click Next.

Specify a project name (such as HelloWorld), choose a project directory, and click Finish.

NetBeans generates the Maven project structure and pom.xml file. Press F6 or click the green Play icon to build and run the application in the Output console.

Project Type: Java with Maven -> Java Application
Project Name: HelloWorld
Target JDK: OpenJDK 21
Build & Run Shortcut: F6 (or Run > Run Project)

Troubleshooting and Common Errors

When configuring Ubuntu servers, unexpected permission errors, network timeouts, or lock contention can occur. Review these common issues and verified resolutions:

NetBeans fails to launch with 'Cannot find java; please use --jdkhome switch'

Resolution: This occurs when the Java binary is missing from your system path or netbeans.conf contains an invalid path. Install OpenJDK using sudo apt install -y default-jdk, or explicitly start NetBeans with: netbeans --jdkhome /usr/lib/jvm/java-21-openjdk-amd64.

High DPI scaling issues or tiny fonts on 4K monitors

Resolution: Open /opt/netbeans/etc/netbeans.conf (or edit snap options) and add -J-Dsun.java2d.uiScale=2 or --fontsize 14 to the netbeans_default_options string.

Maven dependency downloads fail with SSL certificate errors

Resolution: Update your local CA certificates repository by running sudo apt install --reinstall ca-certificates-java && sudo update-ca-certificates to ensure Java trusts modern TLS authority certificates.

Security Best Practices and Hardening

Never launch NetBeans as the root user. Executing IDEs as root risks altering user file ownership and allows untrusted build scripts or Maven plugins to run with unrestricted administrative privileges.

Verify the integrity of third-party plugins before installing them from unofficial NetBeans update centers.

Keep OpenJDK updated promptly via APT security updates to protect against Java runtime vulnerabilities.

Restrict permissions on sensitive configuration and credentials files inside ~/.netbeans and ~/.m2/settings.xml to user-only read/write (chmod 600).

Deepen your Linux system administration skills with our related production-tested guides:

Authoritative References and Official Documentation

Frequently Asked Questions

Quick answers to common questions and configurations

3 FAQs
Yes. Apache NetBeans is licensed under the Apache License 2.0, which permits free use for commercial development, educational instruction, and open-source projects.
Yes. Modern Apache NetBeans releases fully support Java 21, including virtual threads (Project Loom), pattern matching, record patterns, and sequenced collections.
If installed via Snap, run sudo snap remove netbeans. If installed manually via binary archive, delete the directory and launcher: sudo rm -rf /opt/netbeans /usr/local/bin/netbeans /usr/share/applications/netbeans.desktop.
RR
Written byVerified Author

Rajesh Ray

I’m Rajesh Rai, a full-stack developer, Linux administrator, and technology enthusiast passionate about making complex technology easier to understand and use.

SPAM-FREE MODERATED DISCOURSE

Join the Conversation & Perspective

Have thoughts, counterpoints, or reflections on this story? Engage directly with fellow readers and editorial contributors.

AT
MP
JV
+2

No comments on this guide yet. Be the first to share your thoughts or ask a question!

Recommended Reading10 Guides

Related Technical Guides

Tested runbooks, server administration walkthroughs, and troubleshooting guides

Cloud & DevOps•

How to Close File Descriptors Above 9 in Dash Shell

Attempting to close a file descriptor above 9 in Dash using exec 10<&- results in a 10: not found error because Dash's POSIX lexer only recognizes single-digit file descriptors (0–9) in redirection operators. This guide explains the exact parser limitation, why FDs 10+ are reserved for internal shell state, and how to safely close inherited file descriptors using close_range, Python, or Perl wrappers.

RR
Rajesh Rai
Read More
Featured Infrastructure PartnerUp to 75% OFF + 3 Months Free

Supercharge Your Linux & Cloud Workloads with Hostinger

Deploy high-speed NVMe KVM VPS, Docker containers, and LiteSpeed-accelerated WordPress servers in under 60 seconds with full root access, dedicated IPv4, and 24/7 technical support.

Pure NVMe SSD StorageFull Root Access & SSHFree Domain & Unlimited SSL99.9% Uptime SLA
Plans from$2.99/mo
Claim Hostinger DealAffiliate link • Special discount applied at checkout