No announcement yet.

JDK is missing NetBeans Ubuntu

  • Filter
  • Time
  • Show
Clear All
new posts

  • JDK is missing NetBeans Ubuntu

    I have recently installed JDK and I知 getting the following error message when I知 trying to run NetBeans.

    The JDK is missing and is required to run some NetBeans modules
    Please use the --jdkhome command line option to specify a JDK installation or see for more information.
    How could it be fixed?

  • #2
    Which JDK version have you installed?


    • #3
      Originally posted by Aiden View Post
      Which JDK version have you installed?
      The installed version of JDK 1.8.0_131 on Ubuntu 16.04.


      • #4
        Can you please specify, where is your JDK installed?


        • #5
          JDK installed in /usr/bin/java


          • #6
            To summarize the information that was added to the question via comments, you installed Java 9 which is not compatible with NetBeans and then removed it, but NetBeans still shows a warning message that JDK is missing, so you need to update $JAVA_HOME to point to Java 8.

            1. Uninstall NetBeans.
            sudo apt-get purge netbeans
            2. Open the terminal and open /etc/environment file for editing in nano text editor:
            sudo nano /etc/environment
            3. Append the following text string to the end of the line that starts with PATH=" It's the first line in my /etc/environment file.
            :/$JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java" "
            The two " characters at the end are for closing the " in PATH=" and the other " after /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java. I used double quote characters in my /etc/environment file, I hope your /etc/environment uses double quote characters too. You can see that in the /etc/environment file every individual path is separated by the string :/

            Also I don't have any $JAVA_HOME for java-9 in my /etc/environment file, I only have $JAVA_HOME for java-8.

            4. Press the keyboard combination Ctrl+O and after that press Enter to save the file being edited in nano to its current location.

            5. Press the keyboard combination Ctrl+X to exit nano.

            6. Logout and then login again in order that the changes in /etc/environment will take effect.

            7. Reinstall NetBeans.
            sudo apt install netbeans