Tuesday, 27 May 2008

Netbeans 6.0 and Mac OS X (part 2)


(This post was originally written circa Dec. 2007)

To fix the dock icon problem mentioned in the previous post and to run Netbeans directly by clicking the dock icon, with the Metal look and feel, you need to edit the netbeans.conf file.
17864397:etc anujseth$ pwd
/Applications/NetBeans/NetBeans 6.0.app/Contents/Resources/NetBeans/etc
17864397:etc anujseth$ ls -l
total 24
-rw-r--r--  1 root  admin   205 26 Nov 17:43 netbeans.clusters
-rw-r--r--  1 root  admin  1093 26 Dec 20:44 netbeans.conf
-rw-r--r--  1 root  admin  1047 26 Dec 20:44 netbeans.conf_orig_jdk_home
17864397:etc anujseth$ sudo vi netbeans.conf
Password:
17864397:etc anujseth$ 

This is what my file looks like after editing.
# ${HOME} will be replaced by JVM user.home system property
netbeans_default_userdir="${HOME}/.netbeans/6.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=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true"
#---------------------------------
#---------------------------------
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true --laf javax.swing.plaf.metal.MetalLookAndFeel --fontsize 11"
#---------------------------------
#---------------------------------
# (Note that a default -Xmx is selected for you automatically.)
# If you specify the heap size (-Xmx) explicitely, 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/wiki/view/FaqGCPauses)
# Default location of JDK, can be overridden by using --jdkhome :
netbeans_jdkhome=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home
# Additional module clusters, using ${path.separator} (';' on Windows or ':' on Unix):
#netbeans_extraclusters="/absolute/path/to/cluster1:/absolute/path/to/cluster2"

You basically need to add
--laf javax.swing.plaf.metal.MetalLookAndFeel --fontsize 11

, with whatever font size you want, to the
netbeans_default_options

value. You can similarly use the GTK or Windows look and feels etc.
--laf javax.swing.plaf.metal.MetalLookAndFeel
--laf com.sun.java.swing.plaf.motif.MotifLookAndFeel
--laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel
--laf com.sun.java.swing.plaf.windows.WindowsLookAndFeel
--laf javax.swing.plaf.metal.MetalLookAndFeel -J-Dswing.metalTheme=steel

The last one will give you the original (called Steel) look for the Metal Look and Feel, by default the cross platform Metal Look and Feel uses 'Ocean' (yes! it is mind-numbingly confusing). The windows LAF doesn't seem to work, I'm not sure to be honest but it looks a lot like the ocean one.

No comments:

Post a Comment