bookmark_border(Win 7) How to really change your default locale for Java

Since I could not find an easy solution for this problem I have decided to blog about this.

Lets say your machine (running Windows 7) is running in a Dutch locale. If you install the JDK and request the default locale in your application you will get: nl_NL

I’m testing this with the following code:

import java.util.Locale;

public class DefaultLocaleTester {

	public static void main(String[] args) {
		Locale defaultLocale = Locale.getDefault();
		System.out.println("Default locale is : " + defaultLocale);

Lets say I want to make this return en_US. The official docs of Oracle say that you should change your system settings:

– go to Control Panel
– go to Region and Language
– go to tab “Administrative”
– click “Change system locale”
– change to locale you want
– restart and you’re done!

So we do this, and we run the test application again.

You will found out, this will not work. When I rerun the test application I still got nl_NL.

On stackoverflow someone had the answer to this problem. You should be changing your Format instead. So:

– go to Control Panel
– go to Region and Language
– go to tab “Formats” (is default selected)
– change language in Formats dropdown to the locale you want

Now re-run the test code, and you’ll see it will be using the locale you want.

Thanks to Martin Bartlett on Stackoverflow for his answer!

bookmark_borderSlick java library and 64 bit

Note: This post offers a Windows JAR/DLL package. I have delivered a newer version, also for Linux/Mac OS X. Get them from here

A long while ago I played around with Slick. A game library for Java. It offers easy 2d graphics drawing with the speed of OpenGL (by using LJWGL). It has much more features than that as well. 

When I tried it I was running Win XP 32 bit. However, recently I was trying my code again, this time on Windows 7 64 bit, and I encountered the following error:

lwjgl.dll: Can’t load IA 32-bit .dll on a AMD 64-bit platform

I could not find a decent solution easily, but I fixed it by doing this:
Get the latest source of Slick
Download the latest LJWGL version
– Use the latest LJWGL JAR and DLL files and put them into the latest source code of Slick
– Run “ant dist” of Slick

Use the newly generated JAR of Slick and the new DLL files of LJWGL together, and you’re all set for 32 AND 64 bit!

If you just want to download everything (DLL and JAR’s), I’ve made a little archive for Windows users. It is unofficial though, no support given!. Grab it from here.

bookmark_borderItunes and Windows 7 64 bit hot-fix – Did it work for you?

In my previous post I have mentioned a Windows hot-fix for the synchronisation bug you may encounter using Windows 7 64 bit and iTunes 9.0.2.

I can see in the stats that many people have found this blog post. The big question remains: Did it work for you?

Please let me know (add a comment to this post).

bookmark_borderWindows 7 64bit and iTunes 9.02 sync problems

Do you have Windows 7? Perhaps the 64 bits version? Do you have an iPhone, iPod?

Do the following things happen when you try to sinc with iTunes?

– your iphone stops saying it is synchronizing, but iTunes still thinks it is.
– your computer becomes very slow, so slow you actually have to restart it in order to
do your daily things again.
– synchronisation works fine only for Contacts or Calendar items.
“heavier” stuff (ie photo’s or
music) causes the symptoms above.

Don’t worry: You are not alone.

In fact many others have been suffering from the same issue. But, there is hope.

I have tried several ‘solutions’: An XML trick, tweaking your power manager, lowering your max ram or disabling your “standard enhanced pci to usb” device. But I was still not satisfied with the ‘fix’ or ‘workaround’.

The first 2 only work temporarily, or not at all. The 3rd is not desirable, I had installed Win 7 64 bits, so I could use all my 4 GB of RAM.

The last one though works ok, but it disables your USB 2.0 support and thus makes synchronisation very very slow.

I figured that since this seemed to be related to  the USB ports (ie, the last ‘fix’ worked), I dug into Win 7 64 bits USB port related problems. I had found this particular problem. It kind of had the same symptoms, and I found some saying it also infected the iPhone/iPod synchronisation. And, the best news is:

Microsoft have brought up a hot fix to solve this issue

I have tested this fix (just like I did with all the others I have described) and I am glad to say that it works!

If you cannot find it, try this . It has some unofficial download links that may work for you.

I hope it  helps you out, it sure did for me.