Java development environment

JAVA + NETBEANS
Setup Guide

Install OpenJDK 25, download Apache NetBeans 31, point the IDE to your JDK, and add NetBeans to the desktop application menu. This page organizes your supplied installation notes into a reusable walkthrough.

Start installation Java reference ↗ Apache NetBeans ↗ NetBeans 31 ZIP ↗

Installation profile

JDK package
openjdk-25-jdk
Java version
25 from your notes
IDE
Apache NetBeans 31
Archive
netbeans-31-bin.zip
Applications
~/Applications
NetBeans path
~/Applications/netbeans
JDK home
/usr/lib/jvm/java-25-openjdk-amd64
Desktop entry
~/.local/share/applications/apache-netbeans.desktop

Installation flow

1
Install OpenJDKInstall the JDK and verify java / javac
2
Download NetBeansSave and extract the ZIP in ~/Applications
3
Configure the JDK pathSet netbeans_jdkhome in netbeans.conf
4
Add the app launcherCreate and validate a local .desktop entry
01

Install OpenJDK 25

Install the Java Development Kit, which includes both the runtime and compiler.

☕
JDK, not just JRE

For Java development, you need the compiler (javac) as well as the Java runtime. Your notes use the openjdk-25-jdk package.

Terminal · install Java
sudo apt install openjdk-25-jdk

Check Java and the compiler

Run both commands. Your notes use these to confirm that Java and the compiler are available.

Terminal · version checks
java --version
javac --version
ⓘ
Distribution note

Your source file is titled “Installing java in ubuntu” and specifies this APT package name. Package availability can depend on the repositories enabled on the Linux distribution you are using.

02

Find and verify the Java installation path

NetBeans will need the JDK home directory, not the full path to the java executable.

Terminal · resolve java path
readlink -f "$(which java)"

Your supplied notes list this expected executable path:

Expected output path

/usr/lib/jvm/java-25-openjdk-amd64/bin/java

✓
Use the JDK directory in NetBeans

Remove the trailing /bin/java. The value for netbeans_jdkhome is /usr/lib/jvm/java-25-openjdk-amd64.

03

Prepare Applications and download NetBeans

Keep NetBeans in your personal Applications directory rather than installing it system-wide.

Create the Applications directory

Terminal · create directory
mkdir -p ~/Applications

Check the directory

Terminal · verify directory
ls -ld ~/Applications

Your notes show this directory under /home/shoaib/Applications.

Download Apache NetBeans 31

Download the binary ZIP directly into ~/Applications:

Terminal · download ZIP
cd ~/Applications && wget https://dlcdn.apache.org/netbeans/netbeans/31/netbeans-31-bin.zip

Check the downloaded archive

Terminal · list downloaded files
ls -lh ~/Applications/
04

Extract the NetBeans archive

Unpack the ZIP inside ~/Applications.

Terminal · extract archive
cd ~/Applications
unzip netbeans-31-bin.zip

After extraction, your notes expect the NetBeans configuration and executable to be available at these locations:

Configuration

~/Applications/netbeans/etc/netbeans.conf

Launcher

~/Applications/netbeans/bin/netbeans

05

Configure NetBeans to use JDK 25

Set the JDK home explicitly in the NetBeans configuration file.

Open netbeans.conf

Terminal · edit configuration
nano ~/Applications/netbeans/etc/netbeans.conf

Find the commented example line:

Existing example · commented
#netbeans_jdkhome="/path/to/jdk"

Replace it with the following line. Make sure the # at the beginning is removed:

netbeans.conf · active JDK path
netbeans_jdkhome="/usr/lib/jvm/java-25-openjdk-amd64"

Verify the setting

Terminal · check configured JDK
grep '^netbeans_jdkhome' ~/Applications/netbeans/etc/netbeans.conf

Expected output:

netbeans_jdkhome="/usr/lib/jvm/java-25-openjdk-amd64"

06

Test NetBeans, then find its icon

Launch it once from the terminal before creating the desktop application entry.

Launch NetBeans

Terminal · start NetBeans
~/Applications/netbeans/bin/netbeans

Your supplied notes recorded these checks:

IDE version

Apache NetBeans 31

Java version

25.0.5

Find the application icon

Terminal · locate icon files
find ~/Applications/netbeans -type f \( -iname "*.png" -o -iname "*.svg" -o -iname "*.xpm" \) | head -20

The SVG icon identified in your notes is:

/home/shoaib/Applications/netbeans/nb/apache-netbeans.svg

07

Add NetBeans to the desktop application menu

Create a local .desktop file so NetBeans appears in KDE's Application Launcher.

Create the local applications directory

Terminal · prepare desktop entries
mkdir -p ~/.local/share/applications

Create apache-netbeans.desktop

This desktop entry follows the paths and settings in your uploaded notes. It uses the NetBeans launcher and SVG icon from /home/shoaib/Applications/netbeans.

Terminal · create desktop entry
cat > ~/.local/share/applications/apache-netbeans.desktop <<'EOF'
[Desktop Entry]
Version=1.0
Type=Application
Name=Apache NetBeans IDE 31
GenericName=Integrated Development Environment
Comment=Develop Java applications with Apache NetBeans
Exec=/home/shoaib/Applications/netbeans/bin/netbeans %U
Icon=/home/shoaib/Applications/netbeans/nb/apache-netbeans.svg
Terminal=false
Categories=Development;IDE;Java;
StartupNotify=true
StartupWMClass=org-netbeans-modules-masterfs-watcher
EOF
ⓘ
Check the home-directory path

The source notes use /home/shoaib. If your Linux username or home directory is different, replace that prefix in both the Exec and Icon lines before saving the desktop file.

Make the entry executable

Terminal · set permissions
chmod +x ~/.local/share/applications/apache-netbeans.desktop
08

Refresh, validate, and launch from the menu

Finish by refreshing the desktop entry database and checking the file syntax.

Refresh the application database

Terminal · refresh launcher database
update-desktop-database ~/.local/share/applications

Validate the desktop file

Terminal · validate desktop entry
desktop-file-validate ~/.local/share/applications/apache-netbeans.desktop
✓
Expected validation result: no output

No output means the validator did not report a desktop-entry syntax issue.

Launch from KDE

Open the KDE Application Launcher, search for Apache NetBeans IDE 31, and select it. The icon should appear with the application entry.

↗

Command reference

A compact reference for the main commands in this setup.

TaskCommand / location
Install JDKsudo apt install openjdk-25-jdk
Check Javajava --version
Check compilerjavac --version
Resolve Java pathreadlink -f "$(which java)"
NetBeans config~/Applications/netbeans/etc/netbeans.conf
NetBeans launcher~/Applications/netbeans/bin/netbeans
Desktop entry~/.local/share/applications/apache-netbeans.desktop
Refresh app databaseupdate-desktop-database ~/.local/share/applications
Validate desktop filedesktop-file-validate ~/.local/share/applications/apache-netbeans.desktop
↑