Mike's face
Sunday, July 12th, 2020

JavaFX 1.1.1 on Linux

Wednesday April 29, 2009 00:10

Instruction on how to hack the Mac dmg file.

There are instructions on Weiqi Gao's website, but that only works for 1.0. The newer 1.1.1 version wouldn't mount.
You can add an "offset=$((1024*17)) to the loop mount part to fix it. I've reported it on his blog, so he'll probably add this offset. I thought to be helpful with my version.


[ ! "$1" ] && { echo "missing dmg filename"; exit 1; }
bunzip2 -c "$1" >img
mkdir jfx0
sudo mount -o loop,offset=$((1024*17)) img jfx0
mkdir jfx
cd jfx
find ../jfx0 -name "*.gz" -print0 | xargs -0 gunzip -c | cpio -i
cd ..
sudo umount jfx0
rmdir jfx0
rm img

  • chmod +x dmg2jfx.sh
  • ./dmg2jfx.sh javafx_sdk-1_1_1-macosx-universal.dmg
Et voila! Everything is now in a jfx directory.

What led me to this:
fdisk -l img
revealed this:

WARNING: GPT (GUID Partition Table) detected on 'img'! The util fdisk doesn't support GPT. Use GNU Parted.

You must set cylinders.
You can do this from the extra functions menu.

Disk img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Device Boot      Start         End      Blocks   Id  System
  img1               1          17      131071+  ee  EFI GPT
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(1023, 254, 63) logical=(0, 0, 2)
Partition 1 has different physical/logical endings:
     phys=(1023, 254, 63) logical=(16, 81, 1)

I had to try a few different offset, and I didn't expect 17 * 1024 to work, but it did. I wrote a script with a loop inside a loop trying different multipliers to different offsets, which revealed the magic offset. I expected something like 512 or 1024 to work but that didn't.
(I feel like an Amiga hacker all over again, those were the days ;-)

(C) Copyright 2004-2007 Mike Pot