WTK怎样才可以在中文环境中启动模拟器??

C、C++和Java语言
回复
tsone
帖子: 1
注册时间: 2007-12-01 17:48
送出感谢: 0
接收感谢: 0

WTK怎样才可以在中文环境中启动模拟器??

#1

帖子 tsone » 2007-12-01 18:04

在中文环境下, 使用WTK运行项目,模拟器无法启动,一运行就有空指针异常信息(这是WTK自动的范例,代码不可能有错的)

使用

代码: 全选

#!/bin/bash
declare -x LANG="en_US.UTF-8"
declare -x LANGUAGE="en_US"
将系统字符集转为英文字符集后,却能正常启动模拟器,可是中文都变乱码了

现在需要使用中文,有大侠知道有什么解决办法吗???
听某人说去新立得下几个关于AWT和GTK的包安装就可以解决问题,可是在新立得里关于AWT和GTK的东西实在太多了, 有人知道需要下哪几个吗????

我的系统是Ubuntu 7.10 JDK1.6u3 WTK2.5.1

错误信息如下

代码: 全选

项目 "Games" 被载入
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)
	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)
	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)
java.lang.ExceptionInInitializerError
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.sun.kvem.environment.EmulatorInvoker.runEmulatorImpl(Unknown Source)
	at com.sun.kvem.environment.EmulatorInvoker.main(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sun.kvem.environment.JVM.main(Unknown Source)
Caused by: 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.JMenuItem.updateUI(JMenuItem.java:232)
	at javax.swing.JMenuItem.init(JMenuItem.java:194)
	at javax.swing.JMenuItem.<init>(JMenuItem.java:133)
	at javax.swing.JCheckBoxMenuItem.<init>(JCheckBoxMenuItem.java:147)
	at javax.swing.JCheckBoxMenuItem.<init>(JCheckBoxMenuItem.java:87)
	at javax.swing.JCheckBoxMenuItem.<init>(JCheckBoxMenuItem.java:115)
	at com.sun.kvem.midp.MIDP.initMenuActions(Unknown Source)
	at com.sun.kvem.midp.MIDP.<clinit>(Unknown Source)
	... 11 more
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)
	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)
	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)
头像
eagle5678
帖子: 1821
注册时间: 2006-07-08 14:07
送出感谢: 14 次
接收感谢: 1 次

#2

帖子 eagle5678 » 2007-12-14 20:26

Warning: Cannot convert string "-b&h-luxi sans-medium-r-normal--*-140-*-*-p-*-iso8859-1" to type FontStruct
Warning: Cannot convert string "-arphic-ar pl shanheisun uni-medium-r-normal--*-*-*-*-p-*-iso10646-1" to type FontStruct
Warning: Cannot convert string "-arphic-ar pl uming uni-medium-r-normal--*-*-*-*-p-*-iso10646-1" to type FontStruct
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)
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)
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)
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)
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)
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)
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.sun.kvem.environment.EmulatorInvoker.runEmulatorImpl(Unknown Source)
at com.sun.kvem.environment.EmulatorInvoker.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.kvem.environment.JVM.main(Unknown Source)
Caused by: 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.JMenuItem.updateUI(JMenuItem.java:232)
at javax.swing.JMenuItem.init(JMenuItem.java:194)
at javax.swing.JMenuItem.<init>(JMenuItem.java:133)
at javax.swing.JCheckBoxMenuItem.<init>(JCheckBoxMenuItem.java:147)
at javax.swing.JCheckBoxMenuItem.<init>(JCheckBoxMenuItem.java:87)
at javax.swing.JCheckBoxMenuItem.<init>(JCheckBoxMenuItem.java:115)
at com.sun.kvem.midp.MIDP.initMenuActions(Unknown Source)
at com.sun.kvem.midp.MIDP.<clinit>(Unknown Source)
... 11 more

??
wuxb
帖子: 43
注册时间: 2007-03-13 14:08
送出感谢: 0
接收感谢: 0

#3

帖子 wuxb » 2008-01-05 15:31

好像还没有在linux中文的解决办法~ 我的netbeans也全是用的英文……
头像
fishwater_2240
帖子: 27
注册时间: 2005-12-21 17:45
送出感谢: 0
接收感谢: 0

解决方法

#4

帖子 fishwater_2240 » 2008-01-08 13:39

在运行之前首先设置LANG
在控制台下执行
LANG=en_US.UTF-8
然后在控制台下运行ktoolbar就行了,

中文解决
1.
在 jre/lib/fonts/ 下建立个目录 fallback
比如我这儿就是
mkdir /usr/lib/j2sdk1.5-sun/jre/lib/fonts/fallback/

2.
在 fallback 里弄个中文字体
拷贝或链接都可以

比如我这就是
ln -s /usr/share/fonts/truetype/arphic/uming.ttf /usr/lib/j2sdk1.5-sun/jre/lib/fonts/fallback/


3.
进入 jre/lib/fonts/fallback/ 执行 mkfontscale
再把 jre/lib/fonts/fonts.scale 的内容加到 jre/lib/fonts/fonts.dir

我这儿就是
cd /usr/lib/j2sdk1.5-sun/jre/lib/fonts/fallback/
mkfontscale
cd ..
cat fallback/fonts.scale >> fonts.dir


注意:如果通过新立得安装的jre可以按上面的路径操作,如果直接下载的jdk安装包就要把路径修改
peigen
帖子: 234
注册时间: 2006-10-12 21:31
送出感谢: 0
接收感谢: 0

#5

帖子 peigen » 2008-01-26 11:25

不是字体的问题
是sun的jdk theme list里面没有ubuntu的theme,名字是ubuntulooks
Peigen废话
http://peigen.info
回复

回到 “C/C++/Java”