Utilize shell scripts,linux commands, open source tools,java, to Maximize the Power of Linux.
Focused on working with linux and shell, search engine technology including Chinese segmenter
Any questions please contact me at gmail: david.ullua

2/04/2007

JAVA (JDK 1.5, slackware/debian linux)中文显示乱码问题的解决

我用的是slackware, jre的版本是1.5.0_09, 按jhuangjiahua的方法java应用程序的乱码问题可以解决。


标题: 再提 Ubuntu/Debian 下 JAVA 中文显示 作者:jhuangjiahua
来自:http://www.linuxsir.org/bbs/

IRC 上又有朋友问到这 JAVA 的 ,

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


原文地址 http://www.linuxsir.org/bbs/

No comments:

About Me

I am a senior developer and a team leader with 3 years development experience in Suzhou, China, focus on mobile web search, linux, Java and machine learning in NLP (natural language processing). My goal is to improve people's life with computer technology.