Install OpenJDK 25
Install the Java Development Kit, which includes both the runtime and compiler.
For Java development, you need the compiler (javac) as well as the Java runtime. Your notes use the openjdk-25-jdk package.
sudo apt install openjdk-25-jdkCheck Java and the compiler
Run both commands. Your notes use these to confirm that Java and the compiler are available.
java --version
javac --versionYour 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.
Find and verify the Java installation path
NetBeans will need the JDK home directory, not the full path to the java executable.
readlink -f "$(which java)"Your supplied notes list this expected executable path:
Expected output path
/usr/lib/jvm/java-25-openjdk-amd64/bin/java
Remove the trailing /bin/java. The value for netbeans_jdkhome is /usr/lib/jvm/java-25-openjdk-amd64.
Prepare Applications and download NetBeans
Keep NetBeans in your personal Applications directory rather than installing it system-wide.
Create the Applications directory
mkdir -p ~/ApplicationsCheck the directory
ls -ld ~/ApplicationsYour notes show this directory under /home/shoaib/Applications.
Download Apache NetBeans 31
Download the binary ZIP directly into ~/Applications:
cd ~/Applications && wget https://dlcdn.apache.org/netbeans/netbeans/31/netbeans-31-bin.zipCheck the downloaded archive
ls -lh ~/Applications/Extract the NetBeans archive
Unpack the ZIP inside ~/Applications.
cd ~/Applications
unzip netbeans-31-bin.zipAfter 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
Configure NetBeans to use JDK 25
Set the JDK home explicitly in the NetBeans configuration file.
Open netbeans.conf
nano ~/Applications/netbeans/etc/netbeans.confFind the commented example line:
#netbeans_jdkhome="/path/to/jdk"Replace it with the following line. Make sure the # at the beginning is removed:
netbeans_jdkhome="/usr/lib/jvm/java-25-openjdk-amd64"Verify the setting
grep '^netbeans_jdkhome' ~/Applications/netbeans/etc/netbeans.confExpected output:
netbeans_jdkhome="/usr/lib/jvm/java-25-openjdk-amd64"
Test NetBeans, then find its icon
Launch it once from the terminal before creating the desktop application entry.
Launch NetBeans
~/Applications/netbeans/bin/netbeansYour supplied notes recorded these checks:
IDE version
Apache NetBeans 31
Java version
25.0.5
Find the application icon
find ~/Applications/netbeans -type f \( -iname "*.png" -o -iname "*.svg" -o -iname "*.xpm" \) | head -20The SVG icon identified in your notes is:
/home/shoaib/Applications/netbeans/nb/apache-netbeans.svg
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
mkdir -p ~/.local/share/applicationsCreate 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.
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
EOFThe 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
chmod +x ~/.local/share/applications/apache-netbeans.desktopRefresh, validate, and launch from the menu
Finish by refreshing the desktop entry database and checking the file syntax.
Refresh the application database
update-desktop-database ~/.local/share/applicationsValidate the desktop file
desktop-file-validate ~/.local/share/applications/apache-netbeans.desktopNo 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.
| Task | Command / location |
|---|---|
| Install JDK | sudo apt install openjdk-25-jdk |
| Check Java | java --version |
| Check compiler | javac --version |
| Resolve Java path | readlink -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 database | update-desktop-database ~/.local/share/applications |
| Validate desktop file | desktop-file-validate ~/.local/share/applications/apache-netbeans.desktop |