Where’s JAVA_HOME on my Mac OS X?

I was installing CruiseControl on my Mac the other day when I realized that I needed to have JAVA_HOME set. Running which java returned /usr/bin/java. This was a symbolic link to the file /System/Library/Frameworks/JavaVM.framework/Commands/java. Eventually I figured out that the path I was looking for was /System/Library/Frameworks/JavaVM.framework/Home.

Installing Qt 4.0 on Windows

For anyone who’s tried installing Qt4 on Windows you’ll no doubt have had a few problems. Here’s the steps I had to go through to get it working…

  • Make sure you have MinGW installed. I’m using version 4.1.0.
  • Download the file qt-win-opensource-desktop-4.0.0.zip from Trolltech’s website
  • Extract it to the directory where you want to install Qt, e.g. c:\qt\4.0.0
  • Open a command prompt and cd to the directory c:\qt\4.0.0
  • Run the configure program like this, configure -platform win32-g++. You have to use the win32-g++ platform (MinGW) because win32-msvc (MS Visual Studio) is not supported in the open source version of Qt (see here for a lively debat on the topic). If you try running configure -platform win32-msvc you’ll get to accept the license agreement but the configure program will just exit straight away with no explaination of what happened
  • Ensure that the MinGW bin directory is in your PATH environment variable. It’s very important that if you have MSYS installed that it is NOT in your PATH. If it is then the next step will fail because it picks up the cd program from MSYS and fails when trying to cd to windows formatted paths (i.e. paths using \ instead of /)
  • Run mingw32-make. Note that this step takes quite some time (> 1 hour). Note also that you’ll need at about 2GB of disk space to hold all the files built as part of this step.
  • Finally add c:\qt\4.0.0\bin to your PATH environment variable. Ensure also that MinGW is on your PATH so that the Qt applications can find the MinGW binaries at runtime.