问题描述:
我正在尝试使用官方 Netbeans 安装程序在 Debian“Buster”上安装 Netbeans 12.0。尽管发生了以下异常:
No protocol specified
Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "main"
也许您知道上述问题的解决方案?
感谢您的时间!
注意:我知道我可以将 Netbeans 12.0 安装为 snap 包,但我对它不感兴趣。
遵循的步骤:
1)在终端中,我以root用户身份登录:
$ su
Password: ***
2)我安装了软件包openjdk-11-jdk:
$ apt install default-jdk
3)然后我检查了java版本:
$ 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)我将官方文档(Downloading Apache NetBeans 12.0)指定的三个文件下载到“~/Downloads”文件夹中:
- 来自提供的镜像站点的安装程序文件(“Apache-NetBeans-12.0-bin-linux-x64.sh” ) ;
- PGP ASC文件(“ Apache-NetBeans-12.0-bin-linux-x64.sh.asc”);
- 密钥文件。
5)我导航到“下载”文件夹:
$ cd Downloads
6)我在 Netbeans 安装程序文件上设置了执行权限:
$ chmod +x Apache-NetBeans-12.0-bin-linux-x64.sh
7)因为 Netbeans 文档指定了这一点:
正式而言,使用 PGP 签名(.asc 文件)验证下载文件的完整性很重要[...]。PGP 签名应与包含用于签署此版本的 PGP 密钥的KEYS文件匹配。
我按照他们在链接中提供的两个步骤(使用gpg的步骤)来验证安装程序的完整性:
7.a)导入KEYS文件:
$ gpg --import KEYS
gpg: Schlüssel B4C1940FEA9364F1: "Jan Lahoda (Key for signing Apache NetBeans & co. releases.) <jlahoda@apache.org>" nicht geändert
gpg: Schlüssel 13E9F7AE3A4FD551: "geertjan@apache.org (Key for signing Apache NetBeans & co. releases.) <geertjan@apache.org>" nicht geändert
gpg: Schlüssel CF7BA0AB1CCF4647: "Emilian Marius Bold <emi@apache.org>" nicht geändert
gpg: Schlüssel B2BF814FA145CB2D: "Laszlo Kishalmi (CODE SIGNING KEY) <lkishalmi@apache.org>" nicht geändert
gpg: Schlüssel 4A2601CEDA9382F3: "Eric Barboni (Signing Key) <skygo@apache.org>" nicht geändert
gpg: Schlüssel 3703AC389A12A9D4: "Neil C Smith <neilcsmith@apache.org>" nicht geändert
gpg: Schlüssel 57D5896CD86C1320: "Reema Taneja (Code Signing Key) <rtaneja@apache.org>" nicht geändert
gpg: Schlüssel E860B148D27236F9: "Jaroslav Tulach (Key for signing Apache NetBeans & co. releases.) <jtulach@apache.org>" nicht geändert
gpg: Schlüssel 6FA863B0C32A18B1: Öffentlicher Schlüssel "Arunava Sinha (CODE SIGNING KEY) <arusinha@apache.org>" importiert
gpg: Schlüssel 3ED477750C09D18D: Öffentlicher Schlüssel "John McDonnell (CODE SIGNING KEY) <johnmcdonnell@apache.org>" importiert
gpg: Anzahl insgesamt bearbeiteter Schlüssel: 10
gpg: importiert: 2
gpg: unverändert: 8
7.b)验证签名:
$ 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 "skygo@apache.org"
gpg: Korrekte Signatur von "Eric Barboni (Signing Key) <skygo@apache.org>" [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)最后,我执行了安装程序:
$ 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"
我还尝试了“bash”命令:
$ bash Apache-NetBeans-12.0-bin-linux-x64.sh
并使用"./":
$ ./Apache-NetBeans-12.0-bin-linux-x64.sh
不幸的是,每次的结果都是一样的:
No protocol specified
Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "main"
更新:
@Kryštof Vosyka 给出了有效的解决方案:以当前用户身份安装 Netbeans 12.0,而不是作为root用户。
为了应用他的解决方案,除了第6步(在 Netbeans 安装程序文件上设置执行权限)之外,必须遵循上述所有安装步骤。