Java 5 now default VM on OS X

Posted by Jonathan

With the newest Java update (Java 2 Standard Edition 5.0 Release 4) Java 5 is finally the default VM on the Mac:

After installing J2SE 5.0 Release 4, J2SE 5.0 becomes preferred over Java 1.4.2, which will still be installed on your Mac. Applications run with J2SE 5.0 unless they specifically request Java 1.4.2

No need for hacks like this anymore.

Java 5 on Mac OS X Tiger

Posted by Jonathan

As I always forget how to enable Java 5 as the default VM/JDK on OS X I thought I should document it here.

First you need Java 5. Apple does not ship it with Tiger, you need to download it from connect.apple.com after a free registration. After you install it, the Java 5 JDK is available but is not configured as the default VM.

In order to archive this, open the Java Preferences application in /Applications/Utilities/Java/J2SE\ 5.0/. There you can set the VM version for applets in the browser and other Java programs.

But the default JDK on the command line is still Java 1.4.2. If you also want Java 5 as your default command line Java JDK, you need this trick. In /System/Library/Frameworks/JavaVM.framework/Versions there is a symlink called CurrentJDK that controls which JDK is used.

# cd /System/Library/Frameworks/JavaVM.framework/Versions
# sudo rm CurrentJDK
# sudo ln -s 1.5 CurrentJDK

Now if you test it on the command line you get Java 5:

# java -version
java version “1.5.0_05”
Java™ 2 Runtime Environment, Standard Edition (build 1.5.0_05-81)
Java HotSpot™ Client VM (build 1.5.0_05-48, mixed mode, sharing)

Poor man's bootmanager on a Mac

Posted by Jonathan

On my PowerBook I have OpenBSD and Mac OS X installed. As a FreeBSD user I also play with FreeBSD on the PowerPC.

One very disturbing issue is booting. In the Open Firmware you can configure a default boot device (usually your OS X partition) or specify one at the Open Firmware prompt like this:

# boot OpenBSD on the hard disk
boot hd:,ofwboot bsd

# boot FreeBSD on a USB disk
boot hd:,\fbsd_loader usb0/disk@1:3

If you are like me, you use OS X as your default desktop environment and Open/FreeBSD for testing and development. So every time I want to boot Open/FreeBSD I have to drop to Open Firmware and type one of the lines above.

Dario Freri shared his way of booting on the ppc@freebsd.org mailing list (inspired by OS X.

<CHRP-BOOT>
<COMPATIBLE>
MacRISC MacRISC3 MacRISC4
</COMPATIBLE>
<DESCRIPTION>
Multi-boot loader
</DESCRIPTION>
<BOOT-SCRIPT>
” screen” output
” get-key-map” ” keyboard” open-dev $call-method
dup 20 dump
5 + c@ 08 = if
” Booting FreeBSD …” cr ” boot hd:,\fbsd_loader usb0/disk@1:3” eval
else
” Booting Mac OS X…” cr ” boot hd:,\\:tbxi” eval
then
</BOOT-SCRIPT>
</CHRP-BOOT>

Create this file as /boot.tbxi on the OS X partition, set the boot-device to hd:,\boot.tbxi and re-enable the auto-boot? variable in Open Firmware:

setenv auto-boot? true
setenv boot-file hd:,\boot.tbxi
setenv boot-device hd:,\boot.tbxi

Adapting this file to OpenBSD is very easy, just change the boot hd:,\fbsd_loader line to a boot hd:,ofwboot line in /boot.tbxi.

My iPod apparently died...

Posted by Jonathan

...and Apple’s software is not very helpful. If I try to restore it with the iPod Software Updater, I’m being told to restore it?

iPod Software Updater

This iPod is my first piece of Apple hardware that made it over one year without a repair. I already started to wonder if product quality is again on Apple’s agenda.

Widget Manager in OS X 10.4.2

Posted by Jonathan

Apple just released OS X 10.4.2 that includes a Widget Manager. There has been some criticism because there was no way to deactivate or deinstall a widget from the Dashboard or another GUI tool. Apple now introduces the Widget Manager to address these issues.

The Widget Manager is Widget itself. You can use it like any other Widget by clicking on it or dragging it to the Dashboard. Further there is now a new button besides the ”+” button for the Widget Board.

Widget Manager

The Widget Manager will list every installed Widget (System and user installed in ~/Library/Widgets) and will show you if it is an Apple shipped one or not. 3rd party Widget are marked by a red sign. Further you can deactivate each Widget.

Widget Manager

3rd party Widgets can be deinstalled by clicking on the red graphic:

Widget Manager

UPDATE:
If you double-click on a new downloaded Widget, you are asked if you want to install it:

Widget Manager

When the Widget starts you are asked if you want to keep or delete it.

Widget Manager