ºìÁªLinuxÃÅ»§
Linux°ïÖú

linuxÏÂjava swingÎÊÌâµÄ½â¾ö

·¢²¼Ê±¼ä:2008-07-29 01:22:45À´Ô´:ºìÁª×÷Õß:kaiqi
ÔÚlinux×öjava¿ª·¢µÄÅóÓѶ¼ÖªµÀswingÔÚlinuxÏÂÓÐЩºÜÁîÈËÍ·ÌÛµÄÎÊÌâ¡£

µÚÒ»¸öÎÊÌâ¾ÍÊÇscimÊäÈë·¨ºÍswingµÄ³åÍ»ÎÊÌâµ¼Ö¼üÅÌʧЧ£¬ÓÈÆäÊÇ¿ªÁËcompizÖ®ºó¡£

¶ÔÓÚÕâ¸öÎÊÌâÍøÉÏÓкܶദÀíµÄ·½·¨£¬ÀýÈçÌí¼Ó»·¾³±äÁ¿AWT_TOOLKIT=MToolkit£¬Õâ¸ö·½·¨»¹ÊDz»Äܽâ¾öswing³ÌÐòÖмüÅÌʧЧµÄÎÊÌâ¡£

¹úÍâÂÛ̳ÉÏÕÒµ½Ò»¸öºÜºÃµÄ½â¾ö·½·¨¾ÍÊÇ£º

sudo cp ~/.scim/config /root/.scim/

Ö®ºóÎÒÔÚnetbeansÀïÃæ´ÓÀ´Ã»Óз¢Éú¹ý¼üÅÌʧЧµÄÎÊÌâ

µÚ¶þ¸öÂé·³¾ÍÊÇÔÚUbuntuʹÓÃJavaÀ´±àдSwingÓ¦ÓóÌÐòʱһ¸ö±È½Ï´óµÄÎÊÌâ¾ÍÊDz»ÄÜʹÓÃSystemLookAndFeel¡£

ÀýÈçÔËÐÐjconsoleµÄʱºò»á±¨ÈçÏÂ´í£º

Exception in thread "AWT-EventQueue-0" 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)
¡­¡­

ÓеÄÈ˸ø³ö²»ÍêÃÀµÄ½â¾ö·½°¸£¬¾ÍÊÇ°ÑÓïÑÔ»·¾³¸Ä³ÉÓ¢ÎÄ£º

export LANG=en

ÕâÑùswingÓ¦ÓóÌÐò¾Í¿ÉÒÔÕý³£ÔËÐÐÁË£¬µ«ÕâÑù¶ÔÓÚʹÓÃÖÐÎĵÄÓû§À´Ëµ¾ÍºÜ²»·½±ã£¬½çÃæ±ä³ÉÁËÓ¢ÎÄ¡£Êµ¼ÊÉϳöÏÖÕâ¸öÎÊÌâÊÇÒòΪswingµÄĬÈÏlaf²ÉÓÃsystemlaf£¬¶øubuntuÀïȴûÓж¨ÒåÕâ¸ölaf

ºÃµÄ½â¾ö·½·¨ÊÇÔÚ³ÌÐòÆô¶¯Ê±´«µÝJVMÔËÐвÎÊý -Dswing.systemlaf=javax.swing.plaf.metal.MetalLookAndFeel

»òÕßÔÚ/etc/environment ÎļþÔÚ×îºóÔö¼ÓÉÏ£º

_JAVA_OPTIONS="-Dswing.systemlaf=javax.swing.plaf.metal.MetalLookAndFeel"
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 2 ÌõÆÀÂÛ

  1. belltoy ÓÚ 2008-12-29 14:54:33·¢±í:

    תÔØÇë×¢Ã÷×÷Õߺͳö´¦£¡

    ÉÏÃæÕâ¶ÎÄÚÈÝÊÇÀ´×ÔÎÒµÄblog:
    http://belltoy.cn/blog/fix-java-swing-on-linux.html

  2. pig345 ÓÚ 2008-12-10 16:12:36·¢±í:

    лл£¬ºÜʵÓõĶ«Î÷¡£
    sun jvmÔÚwindowsÏÂûÎÊÌ⣬¿´À´sunÀïÃæµÄÈË¿ÉÄÜÒ²ÊÇÓÃwindowsµÄ¾Ó¶à¡£