Cannot run Apache Netbeans 11 using JDK 11

Hunter S :

No matter what I do, I can't get Netbeans 11 to work with JDK 11. Can you help me out?

Please note that this issue does NOT occur with JDK 8.

Downloaded and installed JDK 11 to C:\Program Files\Java\jdk-11.0.4

Downloaded and unzipped Netbeans 11 to C:\Program Files\netbeans

The etc/netbeans.conf file has been edited to set JDK home:

netbeans_jdkhome="C:\Program Files\Java\jdk-11.0.4"

When trying to run bin/netbeans64.exe:

First time: The loading window appears, loads for a bit, and then the whole program disappears.

Second time: Loading window does not appear. An empty Java application appears.

If I go to Task Manager and manually end the Netbeans process, I can get back to First time.

For the attachments listed below, please refer to the issue I created here: https://issues.apache.org/jira/browse/NETBEANS-2865

Executing netbeans64.exe from PowerShell outputs error messages to the console. They can be found in consoleOutput.txt attachment.

The results from executing bin/netbeans64.exe --trace C:\netbeans.log can be found in netbeans.log attachment.

For reference, this is the tutorial I followed:

https://www.youtube.com/watch?v=cxh-hVty09g

Update & Solution

I FINALLY got it to work thanks to the answer provided by skomisa.

The issue was caused by Netbeans 11.0 importing settings from a previous version. There was a popup the first time I ran Netbeans 11.0 asking if I wanted to import my settings from a previous version. Refer to skomisa's answer for more details on why.

To solve it, I deleted ALL of the preference files for NetBeans 11 by deleting the entire folder in AppData.

C:\Users\Hunter\AppData\Roaming\NetBeans\11.0\

Skomisa's answer mentioned trying to create a new unzipped version of NetBeans 11 and not importing the settings. I had actually tried this previously, but never got the popup window asking if you want to import. I assume this is because the user preference files for this version of NetBeans have already been created and are still sitting in AppData.

This leaves you with two viable options:

  1. Delete all of the user preference files for NetBeans 11.0.
  2. Search through the entire folder for instances of \u0000 and remove them.

It seemed easier and more satisfactory to remove the entire folder and start from scratch. That way, all of my user preference files are using the newest practices accepted by the JDK and Netbeans and that, hopefully, there is no lingering legacy code that will randomly break the next time I update.

Thanks for everyone's help!

skomisa :

Your problem appears to be related to the IllegalArgumentException ("Key contains code point U+0000") in the console log output of your bug report. It looks like NetBeans is trying to import your preferences from an earlier release of Netbeans, and is is finding some invalid null character(s) in your preference file(s).

This has been bug reported before, but remains unresolved. See Bug 271652 - IllegalArgumentException: Key contains code point U+0000.

Your preference files are all XML files (with extension xml), and reside in various directories under C:\Users\user ID\AppData\Roaming\NetBeans\11.0\config.

In my case my only preference file for NetBeans 11 is named C:\Users\johndoe\AppData\Roaming\NetBeans\11.0\config\Editors\text\x-java\Preferences\org-netbeans-modules-editor-settings-CustomPreferences.xml but you may have more than one.

From the stack trace in your console log, the failing call is AbstractPreferences.getBoolean(), so the null is probably on a line containing Boolean in your preference file. However, as this somewhat related SO answer suggests, just blindly remove all nulls from all preference files. Nulls should never exist in any XML file anyway.

An alternative approach to solving your problem is to create a new unzipped version of NetBeans 11, but do not import your settings.

I suppose you could even locate the preference files in your existing (broken) NB 11 installation and delete them, though that seems like an unsatisfactory approach even if it works.

A few related points:

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=131928&siteId=1