Issue
Problem description:
I am trying to install Netbeans 12.0 on Debian "Buster", using the official Netbeans installer. Though the following exception occures:
No protocol specified
Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "main"
Maybe you know a solution for the above problem?
Thank you for your time!
Note: I know that I could install Netbeans 12.0 as a snap package, but here I'm not interested in it.
Followed steps:
1) In Terminal, I logged-in as the root user:
$ su
Password: ***
2) I installed the package openjdk-11-jdk:
$ apt install default-jdk
3) Then I checked the java version:
$ java --version
openjdk 11.0.7 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Debian-3deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Debian-3deb10u1, mixed mode, sharing)
4) I downloaded the three files specified by the official documentation (Downloading Apache NetBeans 12.0) into "~/Downloads" folder:
- The installer file ("Apache-NetBeans-12.0-bin-linux-x64.sh") from the offered mirror site;
- The PGP ASC file ("Apache-NetBeans-12.0-bin-linux-x64.sh.asc");
- The KEYS file.
5) I navigated to the "Downloads" folder:
$ cd Downloads
6) I set the execute permission on the Netbeans installer file:
$ chmod +x Apache-NetBeans-12.0-bin-linux-x64.sh
7) Because the Netbeans documentation specifies this:
Officially, it is important that you verify the integrity of the downloaded files using the PGP signatures (.asc file) [...]. The PGP signatures should be matched against the KEYS file which contains the PGP keys used to sign this release.
I followed the two steps (the ones using gpg) that they are providing in their link, in order to verify the integrity of the installer:
7.a) Importing KEYS file:
$ gpg --import KEYS
gpg: Schlüssel B4C1940FEA9364F1: "Jan Lahoda (Key for signing Apache NetBeans & co. releases.) <[email protected]>" nicht geändert
gpg: Schlüssel 13E9F7AE3A4FD551: "[email protected] (Key for signing Apache NetBeans & co. releases.) <[email protected]>" nicht geändert
gpg: Schlüssel CF7BA0AB1CCF4647: "Emilian Marius Bold <[email protected]>" nicht geändert
gpg: Schlüssel B2BF814FA145CB2D: "Laszlo Kishalmi (CODE SIGNING KEY) <[email protected]>" nicht geändert
gpg: Schlüssel 4A2601CEDA9382F3: "Eric Barboni (Signing Key) <[email protected]>" nicht geändert
gpg: Schlüssel 3703AC389A12A9D4: "Neil C Smith <[email protected]>" nicht geändert
gpg: Schlüssel 57D5896CD86C1320: "Reema Taneja (Code Signing Key) <[email protected]>" nicht geändert
gpg: Schlüssel E860B148D27236F9: "Jaroslav Tulach (Key for signing Apache NetBeans & co. releases.) <[email protected]>" nicht geändert
gpg: Schlüssel 6FA863B0C32A18B1: Öffentlicher Schlüssel "Arunava Sinha (CODE SIGNING KEY) <[email protected]>" importiert
gpg: Schlüssel 3ED477750C09D18D: Öffentlicher Schlüssel "John McDonnell (CODE SIGNING KEY) <[email protected]>" importiert
gpg: Anzahl insgesamt bearbeiteter Schlüssel: 10
gpg: importiert: 2
gpg: unverändert: 8
7.b) Verifying the signature:
$ gpg --verify Apache-NetBeans-12.0-bin-linux-x64.sh.asc
gpg: die unterzeichneten Daten sind wohl in 'Apache-NetBeans-12.0-bin-linux-x64.sh'
gpg: Signatur vom Di 09 Jun 2020 17:50:58 CEST
gpg: mittels RSA-Schlüssel 8FE1C26F15E0320E740BAED84A2601CEDA9382F3
gpg: Aussteller "[email protected]"
gpg: Korrekte Signatur von "Eric Barboni (Signing Key) <[email protected]>" [unbekannt]
gpg: WARNUNG: Dieser Schlüssel trägt keine vertrauenswürdige Signatur!
gpg: Es gibt keinen Hinweis, daß die Signatur wirklich dem vorgeblichen Besitzer gehört.
Haupt-Fingerabdruck = 8FE1 C26F 15E0 320E 740B AED8 4A26 01CE DA93 82F3
8) In the end, I executed the installer:
$ sh Apache-NetBeans-12.0-bin-linux-x64.sh
Configuring the installer...
Searching for JVM on the system...
Extracting installation data...
Running the installer wizard...
No protocol specified
Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "main"
I also tried with "bash" command:
$ bash Apache-NetBeans-12.0-bin-linux-x64.sh
and with "./":
$ ./Apache-NetBeans-12.0-bin-linux-x64.sh
Unfortunately, the result is the same each time:
No protocol specified
Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "main"
Update:
@Kryštof Vosyka gave the working solution: to install Netbeans 12.0 as the current user, not as the root user.
In order to apply his solution, all the above installation steps are to be followed, with the exception of step 6 (setting the execute permission on the Netbeans installer file).
Solution
I had the same problem, and solution is quite simple:
Don't start the installation as root.
The installer is graphical and root user cannot really open windows for your user, thus failing. No idea how to install it for all users, though.
Answered By - Kryštof Vosyka
Answer Checked By - Terry (JavaFixing Volunteer)