Netbeans统一UTF-8编码的方法

一直在网上找这个问题的解决方法,可是都是只有Netbenas5.5的解决方案,而且并没有根本的解决,今天上官方看了下,原来官方就有解决方法~哈哈~这招可以解决目前所有的版本,全部文件将用UTF-8解码.所以转移工作平台就更加简单咯~
这是原文:
For those who need to use international and multibyte characters, NetBeans can support UTF-8 editing. To enable it, go to your NetBeans installation directory and find the etc folder. There will be a file there called netbeans.conf .

This file keeps some configuration for NetBeans, including the default command line arguments. These are parameters that will be sent to a new starting Netbeans IDE.

Every argument lives inside a double-quoted variable called netbeans_default_options , and each one is separated from another by a space.

To enable UTF-8 in NetBeans, just place this parameter anywhere on the list of netbeans_default_options:-J-Dfile.encoding=UTF-8

中文解释一下:
1.找到你的Netbeans安装目录下的etc文件夹,如C:\Program Files\NetBeans 6.0 M9\etc
2.用记事本打开netbeans.conf
3.找到netbeans_default_options这一句(没带#号的,带#号的是注释)
4.在最后面加上一个空格,再加入-J-Dfile.encoding=UTF-8
如我现在的设置:
netbeans_default_options="-J-DAM_CONFIG_FILE=\"C:\Sun\AppServer\domains\domain1\config\AMConfig.properties\" -J-Dcom.sun.aas.installRoot=\"C:\Sun\AppServer\" -J-Xms128m -J-Xmx512m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -J-Dapple.laf.useScreenMenuBar=true -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled -J-Dfile.encoding=UTF-8 "
这样,打开的文件所有都用UTF-8解码了~哈哈,不再有乱码咯~

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值