FaqLinuxGTKIssueJa

Linux で NetBeans が起動しません。GTKLookAndFeel 関係の例外が発生しているようです。どうしたらよいですか?

Linux などの GNOME 環境で JDK6 の u10 より前の JDK 6 を使っている場合に NetBeans 自体が起動しなかったり、Mobility のエミュレータが起動しなかったり、Java Desktop アプリケーションが起動しない場合があります。以下の例外が発生します。

致命的 [Global]
java.lang.NullPointerException
	at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.initSystemColorDefaults(GTKLookAndFeel.java:1267)
	at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.loadStyles(GTKLookAndFeel.java:1509)
	at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.access$000(GTKLookAndFeel.java:37)
	at com.sun.java.swing.plaf.gtk.GTKLookAndFeel$WeakPCL$1.run(GTKLookAndFeel.java:1449)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
[Catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
警告 [Org.netbeans.core.modules]: the module org.netbeans.modules.xml.text uses org.netbeans.modules.editor.deprecated.pre61completion which is deprecated.
警告 [Org.netbeans.core.modules]: the module org.netbeans.modules.db uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead.
java.lang.NullPointerException
	at javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:117)
	at javax.swing.UIDefaults.getUI(UIDefaults.java:741)
	at javax.swing.UIManager.getUI(UIManager.java:1012)
	at javax.swing.JViewport.updateUI(JViewport.java:295)
	at javax.swing.JViewport.<init>(JViewport.java:255)
	at javax.swing.JScrollPane.createViewport(JScrollPane.java:908)
	at javax.swing.JScrollPane.<init>(JScrollPane.java:283)
	at javax.swing.JScrollPane.<init>(JScrollPane.java:336)
	at org.netbeans.swing.plaf.gtk.GtkLFCustoms.createApplicationSpecificKeysAndValues(GtkLFCustoms.java:94)
	at org.netbeans.swing.plaf.LFCustoms.getApplicationSpecificKeysAndValues(LFCustoms.java:93)
	at org.netbeans.swing.plaf.Startup.installLFCustoms(Startup.java:310)
	at org.netbeans.swing.plaf.Startup.installPerLFDefaults(Startup.java:240)
	at org.netbeans.swing.plaf.Startup.install(Startup.java:222)
	at org.netbeans.swing.plaf.Startup.run(Startup.java:443)
	at org.netbeans.core.CoreBridgeImpl.initializePlaf(CoreBridgeImpl.java:120)
	at org.netbeans.core.startup.Main.initUICustomizations(Main.java:138)
	at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:335)
	at org.netbeans.ModuleManager.enable(ModuleManager.java:906)
	at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:428)
	at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:364)
	at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
	at org.netbeans.core.startup.Main.getModuleSystem(Main.java:165)
	at org.netbeans.core.startup.Main.start(Main.java:312)
	at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:110)
	at java.lang.Thread.run(Thread.java:619)

回避策

これは JDK のバグ 6389282 で、JDK6 u10 で修正されています。JDK6 u10 を使ってください。

JDK6 u10 にアップグレードできな場合は、これは GTK L&F の問題なので Metal などの他の L&F を使うことで回避できます。

% ./netbeans --laf javax.swing.plaf.metal.MetalLookAndFeel

また JDK5 では発生しません。英語ロケールでは発生しません。


Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo