Gangmax Blog

配置Netbeans使用的语言,字体平滑和JDK

当安装Netbeans的时候,貌似它会根据操作系统的环境自动选择语言。比如我用中文,则Netbeans安装后会自动使用中文界面。而我实际上想要英文界面。

Netbeans还有一个问题是默认使用的字体并不理想,看着挺难看。不知道是没有抗锯齿还是怎么回事,看着有些模糊。

另外,有些情况下需要指定Netbean使用的JDK。

以上问题,都可以通过修改其配置文件”${NETBEANS_HOME}/etc/netbeans.conf”解决,这是一个例子:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# ${HOME} will be replaced by JVM user.home system property
netbeans_default_userdir="${HOME}/.netbeans/7.0"

# Options used by NetBeans launcher by default, can be overridden by explicit
# command line switches:
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=384m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dawt.useSystemAAFontSettings=on -J-Duser.language=en -J-Duser.country=US"
# Note that a default -Xmx is selected for you automatically.
# You can find this value in var/log/messages.log file in your userdir.
# The automatically selected value can be overridden by specifying -J-Xmx here
# or on the command line.

# If you specify the heap size (-Xmx) explicitly, you may also want to enable
# Concurrent Mark & Sweep garbage collector. In such case add the following
# options to the netbeans_default_options:
# -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled
# (see http://wiki.netbeans.org/FaqGCPauses)

# Default location of JDK, can be overridden by using --jdkhome :
netbeans_jdkhome="/home/user/java/jdk1.6.0_23"

# Additional module clusters, using ${path.separator} (';' on Windows or ':' on Unix):
#netbeans_extraclusters="/absolute/path/to/cluster1:/absolute/path/to/cluster2"

# If you have some problems with detect of proxy settings, you may want to enable
# detect the proxy settings provided by JDK5 or higher.
# In such case add -J-Djava.net.useSystemProxies=true to the netbeans_default_options.

这个文件本质上应该是个properties文件。其中:

  1. 第6行中“netbeans_default_options”内容中的“-J-Dawt.useSystemAAFontSettings=on”对应字体设置;

  2. 第6行中“netbeans_default_options”内容中的“-J-Duser.language=en -J-Duser.country=US”对应界面语言设置;

  3. 第19行中的“netbeans_jdkhome”对应Netbeans使用的JDK设置。

Comments