当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 5 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : WTK怎样才可以在中文环境中启动模拟器??
帖子发表于 : 2007-12-01 18:04 

注册: 2007-12-01 17:48
帖子: 1
送出感谢: 0 次
接收感谢: 0 次
在中文环境下, 使用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)


页首
 用户资料  
 
2 楼 
 文章标题 :
帖子发表于 : 2007-12-14 20:26 
头像

注册: 2006-07-08 14:07
帖子: 1773
送出感谢: 14
接收感谢: 1
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

??


页首
 用户资料  
 
3 楼 
 文章标题 :
帖子发表于 : 2008-01-05 15:31 

注册: 2007-03-13 14:08
帖子: 43
送出感谢: 0 次
接收感谢: 0 次
好像还没有在linux中文的解决办法~ 我的netbeans也全是用的英文……


页首
 用户资料  
 
4 楼 
 文章标题 : 解决方法
帖子发表于 : 2008-01-08 13:39 
头像

注册: 2005-12-21 17:45
帖子: 27
送出感谢: 0 次
接收感谢: 0 次
在运行之前首先设置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安装包就要把路径修改


页首
 用户资料  
 
5 楼 
 文章标题 :
帖子发表于 : 2008-01-26 11:25 

注册: 2006-10-12 21:31
帖子: 234
送出感谢: 0 次
接收感谢: 0 次
不是字体的问题
是sun的jdk theme list里面没有ubuntu的theme,名字是ubuntulooks


_________________
Peigen废话
http://peigen.info


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 5 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 3 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译