Java 11 Required After Netbeans Update – Java

by
Liam Thompson
netbeans ubuntu-18.04

Quick Fix: For Windows users, if you are facing issues after updating NetBeans, you can manually install JDK-20 and then reinstall NetBeans while directing it to the JDK-20 folder. This should resolve the issue.

The Problem:

A user has Netbeans version 19 installed on Ubuntu 18.04.6 LTS. After the update, Netbeans stopped working and shows a popup saying "Java 11 or newer required". The user currently runs Java 8 and some dependencies do not support Java 11. The user tried installing Java 11, setting the default Java to Java 11, editing the jdkhome line in netbeans.conf, and using the –jdkhome flag. Even when the user tries to start Netbeans from the terminal using –jdkhome, the program starts but doesn’t fix the problem and still fails when opened from the desktop icon.

The Solutions:

Solution 1: Uninstall Netbeans-19, Install JDK-20, and Reinstall Netbeans-19

  1. Uninstall Netbeans-19:

    • Open the Control Panel on your computer.
    • Click on Programs and Features.
    • Find Netbeans-19 in the list of installed programs and click on Uninstall.
    • Follow the prompts to complete the uninstallation.
  2. Install JDK-20:

  3. Reinstall Netbeans-19:

    • Download the Netbeans-19 installer from the Netbeans website:

      https://netbeans.apache.org/download/index.html

    • Run the Netbeans-19 installer and follow the prompts to complete the installation.

    • During the installation, be sure to select the Custom installation type and specify the JDK-20 folder as the Java Runtime Environment (JRE) to use.

  4. Point Netbeans-19 to the JDK-20 Folder:

    • Once Netbeans-19 is installed, open the Netbeans preferences dialog box.
    • Click on the Java tab.
    • In the Java Platform field, select JDK-20.
    • Click on the OK button to save your changes.
  5. Launch Netbeans-19:

    • You should now be able to launch Netbeans-19 without encountering the "Java 11 or newer required" error message.

Solution 2: Workaround

Although NetBeans itself requires JDK 11, you can still build and run JDK 8 for your projects. Refer to the article Overview of JDK 8 Support in NetBeans IDE for more information.

If you encounter difficulties, you can also refer to the StackOverflow question How can I set the JDK NetBeans runs on? to help you set the specific JDK that NetBeans should use.

Solution 3: Don’t Upgrade NetBeans

Instead of upgrading to NetBeans 19, you can continue using NetBeans 18.x. This will allow you to keep using Java 8 with NetBeans. You can download the older version of NetBeans from the Apache NetBeans website.

To prevent NetBeans from being updated in the future, you can disable automatic updates in the NetBeans preferences. Go to Tools > Options and select the Updates tab. Uncheck the Check for updates automatically checkbox.

Solution 4: Set netbeans_jdkhome Variable

Edit the `netbeans.conf` file and set the `netbeans_jdkhome` variable to the directory where Java 11 is installed. For example:


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

Save the file and launch Netbeans. It should now start successfully.

Q&A

How to fix Netbeans not opening after update?

Install Java 11 or newer or use the –jdkhome switch to point to its installation directory.

Can I still use Java 8 for my projects even though NetBeans requires JDK 11?

Yes, you can still build and run JDK 8 for your projects.

Does the NetBeans JDK range affect the projects?

No, the Runtime JDK NetBeans uses does not influence the JDK range projects can use.

Video Explanation:

The following video, titled "How to Install NetBeans IDE And Java JDK on Windows 10 - YouTube", provides additional insights and in-depth exploration related to the topics discussed in this post.

Play video

This Video tells you how to download Netbeans 11 IDE for Windows 10. In this tutorial, we will learn how to install Netbeans IDE on Windows ...