netbeans fails to start due to java9

Bug #1763091 reported by Nish Aravamudan on 2018-04-11
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
netbeans (Ubuntu)
Undecided
Nish Aravamudan

Bug Description

$ netbeans
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.netbeans.ProxyURLStreamHandlerFactory (file:/usr/share/netbeans/platform18/lib/boot.jar) to field java.net.URL.handler
WARNING: Please consider reporting this to the maintainers of org.netbeans.ProxyURLStreamHandlerFactory
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Cursory googling around, implies this is java9 incompatibility; netbeans 9 is the first release to support java 9 (it's unclear if 8.2 does). The simplest fix is to rebuild with just java 8 support and use java 8 at runtime.

Nish Aravamudan (nacc) on 2018-04-11
Changed in netbeans (Ubuntu):
status: New → In Progress
assignee: nobody → Nish Aravamudan (nacc)
Managor (managor) wrote :

I'm having the same problem with a fresh Xubuntu 18.04 install

I'm having the same problem with a fresh Ubuntu 18.04 install.
I installed netbeans through the command:

sudo apt install netbeans

I had the same error:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.netbeans.ProxyURLStreamHandlerFactory (file:/usr/share/netbeans/platform18/lib/boot.jar) to field java.net.URL.handler
WARNING: Please consider reporting this to the maintainers of org.netbeans.ProxyURLStreamHandlerFactory
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

The netbeans package (https://packages.ubuntu.com/fr/bionic/netbeans) states that it has default-jdk as dependency which installs openjdk-11-jdk by default but the current netbeans version uses Java 8.

I installed openjdk-8-jdk manually by:

sudo apt-get install openjdk-8-jdk

Then I used Java 8 as default Java version to use:

sudo update-alternatives --config java
sudo update-alternatives --config javac

Now I don't have error messages but netbeans fails to start anyway.

I attach to this the content of ~/.netbeans/8.1/var/log/messages.log

As it seems Netbeans now fails because of the version of libequinox-osgi-java (https://bugs.debian.org/891957).

Alejandro Arcos (arcosaf) wrote :

I have the same problem, with the IDE. If urgent for my case, download jdk-8u171-nb-8_2-linux-x64.sh from netbeans.org.

Before install run autoremove openjdk-8-"all" and netbeans if is installed.

And then install jdk-8u171-nb-8_2-linux-x64.sh this package contains jdk 8

Best

Alejandro

ais523 (ais523) wrote :

I believe that there are two separate bugs here.

One is the deprecated reflective access. However, that isn't what's preventing NetBeans from loading; it's only a warning after all.

I think the failure to load is a different bug. That's being discussed in #1760907.

ais523 (ais523) wrote :

(By the way, should this bug be marked as a duplicate of #1760907? I assume most people who are subscribed to this care more about the crash than the use of a deprecated feature that still works. The crash has nothing to do with Java 9, though; it can be reproduced even running NetBeans under Java 8.)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.