java.lang.RuntimeException:无法加载系统光标:DnD.Cursor.CopyDrop

java.lang.RuntimeException:无法加载系统光标:DnD.Cursor.CopyDrop

有人知道这个错误信息的含义吗?

java.lang.RuntimeException: failed to load system cursor: DnD.Cursor.CopyDrop

在全新安装 Ubuntu 17.10 (Xfce) 和 OpenJava1.8 后,Netbeans 在显示启动画面时冻结。另一个 JavaApp“TV-Browser”也存在问题。其他 Java Apps 运行正常。~/.netbeans/8.2/var/log/messages.log显示:

-----------------------------------------------------------------------
Log Session: Wednesday, November 29, 2017 3:02:48 PM CET
System Info: 
Product Version = NetBeans IDE 8.2 (Build 201609300101) (#5fd841261bf9)
Operating System = Linux version 4.13.0-17-generic running on amd64
Java; VM; Vendor = 1.8.0_151; OpenJDK 64-Bit Server VM 25.151-b12; Oracle Corporation
Runtime = OpenJDK Runtime Environment 1.8.0_151-8u151-b12-0ubuntu0.17.10.2-b12
Java Home = /usr/lib/jvm/java-8-openjdk-amd64/jre
System Locale; Encoding = de_DE (nb); UTF-8
Home Directory = /home/ralph
Current Directory = /home/ralph
User Directory = /home/ralph/.netbeans/8.2
Cache Directory = /home/ralph/.cache/netbeans/8.2
Installation = /usr/local/netbeans-8.2/nb
/usr/local/netbeans-8.2/ide
/usr/local/netbeans-8.2/extide
/usr/local/netbeans-8.2/java
/usr/local/netbeans-8.2/apisupport
/usr/local/netbeans-8.2/websvccommon
/usr/local/netbeans-8.2/profiler
/usr/local/netbeans-8.2/harness
/usr/local/netbeans-8.2/javafx
/usr/local/netbeans-8.2/platform

[..]

java.lang.RuntimeException: failed to load system cursor: DnD.Cursor.CopyDrop : cannot load system cursor: CopyDrop.32x32
at java.awt.dnd.DragSource.load(DragSource.java:135)
at java.awt.dnd.DragSource.<clinit>(DragSource.java:148)
Caused: java.lang.ExceptionInInitializerError
at org.netbeans.core.windows.view.ui.toolbars.DnDSupport.<clinit>(DnDSupport.java:118)
at org.netbeans.core.windows.view.ui.toolbars.ToolbarConfiguration.dndSupport(ToolbarConfiguration.java:132)
at org.netbeans.core.windows.view.ui.toolbars.ToolbarConfiguration.refresh(ToolbarConfiguration.java:312)
at org.netbeans.core.windows.view.ui.toolbars.ToolbarConfiguration.activate(ToolbarConfiguration.java:400)
at org.openide.awt.ToolbarPool.activate(ToolbarPool.java:245)
at org.openide.awt.ToolbarPool.setConfigurationNow(ToolbarPool.java:329)
at org.openide.awt.ToolbarPool.setConfiguration(ToolbarPool.java:301)
at org.netbeans.core.windows.view.DefaultView.showWindowSystem(DefaultView.java:567)
at org.netbeans.core.windows.view.DefaultView.windowSystemVisibilityChanged(DefaultView.java:542)
at org.netbeans.core.windows.view.DefaultView.changeGUI(DefaultView.java:187)
at org.netbeans.core.windows.ViewRequestor.dispatchRequest(ViewRequestor.java:275)
at org.netbeans.core.windows.ViewRequestor.processVisibilityRequest(ViewRequestor.java:264)
at org.netbeans.core.windows.ViewRequestor.postVisibilityRequest(ViewRequestor.java:201)
at org.netbeans.core.windows.ViewRequestor.scheduleRequest(ViewRequestor.java:121)
at org.netbeans.core.windows.Central.setVisible(Central.java:140)
at org.netbeans.core.windows.WindowManagerImpl.setVisible(WindowManagerImpl.java:931)
at org.netbeans.core.windows.WindowSystemImpl.show(WindowSystemImpl.java:105)
at org.netbeans.core.GuiRunLevel$InitWinSys.run(GuiRunLevel.java:244)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
java.lang.RuntimeException: cannot load system cursor: CopyDrop.32x32
at sun.awt.X11.XToolkit.lazilyLoadDesktopProperty(XToolkit.java:1541)
at java.awt.Toolkit.getDesktopProperty(Toolkit.java:1803)
at java.awt.dnd.DragSource.load(DragSource.java:131)
at java.awt.dnd.DragSource.<clinit>(DragSource.java:148)
at org.netbeans.core.windows.view.ui.toolbars.DnDSupport.<clinit>(DnDSupport.java:118)
at org.netbeans.core.windows.view.ui.toolbars.ToolbarConfiguration.dndSupport(ToolbarConfiguration.java:132)
at org.netbeans.core.windows.view.ui.toolbars.ToolbarConfiguration.refresh(ToolbarConfiguration.java:312)
at org.netbeans.core.windows.view.ui.toolbars.ToolbarConfiguration.activate(ToolbarConfiguration.java:400)
at org.openide.awt.ToolbarPool.activate(ToolbarPool.java:245)
at org.openide.awt.ToolbarPool.setConfigurationNow(ToolbarPool.java:329)
at org.openide.awt.ToolbarPool.setConfiguration(ToolbarPool.java:301)
at org.netbeans.core.windows.view.DefaultView.showWindowSystem(DefaultView.java:567)
at org.netbeans.core.windows.view.DefaultView.windowSystemVisibilityChanged(DefaultView.java:542)
at org.netbeans.core.windows.view.DefaultView.changeGUI(DefaultView.java:187)
at org.netbeans.core.windows.ViewRequestor.dispatchRequest(ViewRequestor.java:275)
at org.netbeans.core.windows.ViewRequestor.processVisibilityRequest(ViewRequestor.java:264)
at org.netbeans.core.windows.ViewRequestor.postVisibilityRequest(ViewRequestor.java:201)
at org.netbeans.core.windows.ViewRequestor.scheduleRequest(ViewRequestor.java:121)
at org.netbeans.core.windows.Central.setVisible(Central.java:140)
at org.netbeans.core.windows.WindowManagerImpl.setVisible(WindowManagerImpl.java:931)
at org.netbeans.core.windows.WindowSystemImpl.show(WindowSystemImpl.java:105)
at org.netbeans.core.GuiRunLevel$InitWinSys.run(GuiRunLevel.java:244)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.awt.AWTException: Exception: class java.lang.IllegalArgumentException Width (0) and height (0) must be non-zero occurred while creating cursor CopyDrop.32x32
at java.awt.Cursor.getSystemCustomCursor(Cursor.java:363)
at sun.awt.X11.XToolkit.lazilyLoadDesktopProperty(XToolkit.java:1539)
... 36 more
INFO [org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalogParser]: Unpaired license 00000008 without any module.

答案1

正如所指出的大卫·福斯特这条评论,OpenJDK 8 中的这个错误似乎已被修复,修复方法是安装OpenJDK 9。适用于 Universe 存储库中的 17.10 版本。

第一的,启用存储库如果还没有的话。

其次使用命令安装 OpenJDK 9sudo apt install openjdk-9-jdk

如果出于某种原因你希望保留 OpenJDK 8,你可能需要熟悉如何在多个 Java 版本之间切换

相关内容