Enabling anti-aliased fonts in Netbeans

Having recently switched back to Linux on my main development machine I’ve been using my trusty IDE – Netbeans, I noticed however that on Microsoft Windows and Apple OSX Netbeans text is anti-aliased by default but is not the case on my current Linux distrubution (Ubuntu 14.04).

So this is a quick post to demonstrate how to enable this on Linux (I assume it will work for most distrubutions atleast!)

It’s very simple, all we need to do is sudo and edit the netbeans configuration file, so using the terminal lets use Nano to edit the file:

sudo nano /usr/local/netbeans-8.0.2/etc/netbeans.conf

Obviously, you may just have to change the Netbeans version number to match the directory, as you can tell at the time of writing the Netbeans version I am using is 8.0.2!

Now, on (or around) line number 46, you should see a string of text like so:-

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true"

We are now simply going to append that line with a couple of additional flags (settings), so lets add -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=on so the line now reads:-

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=on"

Great! – Save the file and restart Netbeans…. You should  now notice that the IDE is using Anti-aliased text!