Rough Book

random musings of just another computer nerd

Tag: sdk

Running the JavaFX 1.1 SDK on Linux

This is an update to my instructions on running the JavaFX 1.0 SDK on Linux. Those instructions do not work on the dmg image for the 1.1 version of the SDK.

Mike (thanks Mike!) posted a comment on that blog mentioning a small change that needed to be made. To get JavaFX 1.1 on Linux, first follow the steps in the original guide. When you need to mount the dmg, you need to provide an offset. So instead of the original command, do the following:

vivin@dauntless ~
$; sudo mount -o loop,offset=$((1024*17)) -t hfsplus javafx_sdk-1_0-macosx-universal.dmg.out javafx

The dmg should be mounted now.

Running the JavaFX 1.0 SDK on Linux

The JavaFX 1.0 SDK was released today. I’ve played with the preview SDK, so I was pretty excited to try out the 1.0 SDK. Inexplicably, and this was the case with the preview SDK as well, Sun hasn’t released a version of the SDK for Linux. However, this wasn’t a problem because it was possible to run the Mac version of the Preview SDK on Linux. The preview SDK came in the form of a zip, but the 1.0 SDK comes in the form of a dmg, so I was initially stumped. But I’ve figured out how to get the Mac version of the SDK to work on Linux. It’s a little more complicated than getting the preview SDK to work, but it works!

The thing about dmg files is that you can easily mount them on Linux since they are essentially stored in the HFS Plus filesystem format. So I immediately set about trying to mount it:

vivin@dauntless ~
$ mkdir javafx

vivin@dauntless ~
$ sudo mount -o loop -t hfsplus javafx_sdk-1_0-macosx-universal.dmg javafx
[sudo] password for vivin: 
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Hmm… ok, that wasn’t what I expected, so I tried to see what type of file it was:

vivin@dauntless ~
$; file javafx_sdk-1_0-macosx-universal.dmg
javafx_sdk-1_0-macosx-universal.dmg: bzip2 compressed data, block size = 100k

Ok, so it look’s like it’s a bzipped file. All we need to do then, is bunzip it and mount it:

vivin@dauntless ~
$ bunzip2 javafx_sdk-1_0-macosx-universal.dmg
bunzip2: Can't guess original name for javafx_sdk-1_0-macosx-universal.dmg -- using javafx_sdk-1_0-macosx-universal.dmg.out

bunzip2: javafx_sdk-1_0-macosx-universal.dmg: trailing garbage after EOF ignored

vivin@dauntless ~
$ sudo mount -o loop -t hfsplus javafx_sdk-1_0-macosx-universal.dmg.out javafx

vivin@dauntless ~
$ ls javafx
javafx_sdk-1_0.mpkg

Awesome! So we were able to get the dmg mounted. Now all we need to do is find were the SDK lives. After going through the dmg, I found out that the SDK is stored in a compressed (gzipped) file. You can find it at <mountpoint>/javafx_sdk-1_0.mpkg/Contents/Packages/javafxsdk.pkg/Contents/Archive.pax.gz. Copy this file into another working directory (or wherever you want your SDK to reside. I put mine in /usr/local):

vivin@dauntless ~/working
$ cp ~/javafx/javafx_sdk-1_0.mpkg/Contents/Packages/javafxsdk.pkg/Contents/Archive.pax.gz .

vivin@dauntless ~/working
$ gunzip Archive.pax.gz

vivin@dauntless ~/working
$ file Archive.pax
Archive.pax: ASCII cpio archive (pre-SVR4 or odc)

When I gunzipped the file, I got Archive.pax, and I wasn’t sure what to do with it. So I ran file on it and discovered that it was a cpio file. Some quick Googling and man-page perusal later:

vivin@dauntless ~/working
$ cpio -i <Archive.pax
65687 blocks

vivin@dauntless ~/working
$ ls
Archive.pax  COPYRIGHT.html  lib          profiles     samples     src.zip                      timestamp
bin          docs            LICENSE.txt  README.html  servicetag  THIRDPARTYLICENSEREADME.txt

vivin@dauntless ~/working
$ bin/javafx

Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)

where options include:
    -d32          use a 32-bit data model if available

    -d64          use a 64-bit data model if available
    -client	  to select the "client" VM
    -server	  to select the "server" VM
    -hotspot	  is a synonym for the "client" VM  [deprecated]
                  The default VM is server, 
                  because you are running on a server-class machine.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A : separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D<name>=<value>
                  set a system property
    -verbose[:class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:<value>
                  require the specified version to run
    -showversion  print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
                  include/exclude user private JREs in the version search
    -? -help      print this help message
    -X            print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
                  enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
                  disable assertions
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:hprof
                    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument

As you can see, you now have a working JavaFX 1.0 SDK on your Linux box!

My new T-Mobile G1 Android Phone

So I got my T-Mobile G1 Android phone yesterday, and boy am I excited! I had mixed feelings about it initially because I wasn’t so sure of the form factor. I remember thinking that it looked a little clunky, but now that I have it here, in my hand, I have to say that it feels well-made and rather solid. The exterior is made of plastic, and it feels smooth to the touch and not cheap at all. The keyboard slides out smoothly and I’ve had no problem typing on it. The interface is pretty snappy. I was actually surprised at how smooth and responsive it was. As far as the interface is concerned, the only issue I have is with the zooming. It may just be that I haven’t figured out to activate it reliably. I guess they had to go with this method because Apple is trying to patent the “pinch” motion for zooming. I think that is completely stupid, of course, and the patent office should throw it out.

Anyway, so once I picked up the phone I opened up the package and carefully laid everything out. T-Mobile sent me another SIM card with it, which didn’t work; I guess you have to activate it. But that really wasn’t a problem since I have my old SIM card. Once I put it in the phone and hooked up the new battery, I started up the phone. When it firsts starts up, it asks you for your Google account information so that you can sync everything with your phone. As soon as it synced up (which happened within a matter of seconds), I was good to go. I started off by trying to import my contacts from the SIM card. This is where I came across a problem. Apparently (I could be wrong, I was too impatient to explore more options) you can’t import all your SIM contacts in one go. You have to do it one by one. I found that a little annoying. You can either import your contacts one-by-one, or import them all in one go by hitting the Menu button and then choosing the Import all option. As soon as I had my contacts imported, I started exploring the other options. The home screen is pretty sweet. You can drag and drop icons on there, and swipe left and right to either add more icons or run google search. In addition to GMail, you can add other POP3/IMAP accounts and you can also use other IM networks in addition to GTalk. The G1 also has a music player and a bunch of sample tracks (including Flight of the Conchord’s “The Most Beautiful Girl in the Room”). The phone doesn’t have a headphone jack, so you have to get a USB to 3.5mm converter. The Bluetooth works fine and synced up to the Hands-free Link in my Acura without any problem. Although, like the iPhone, you can’t transfer files via bluetooth. I imagine that they will fix this eventually. The phone also has a feature where you can set up a “pattern” to unlock it. You have to “draw” a pattern on the screen connecting nine dots (laid in a 3×3 grid pattern) to unlock the phone. The other cool thing was the “Compass Mode” in the Google Maps street view. The phone adjusts the street view based on where you’re pointing it, and so the scene on the phone actually moves when you move the phone. It’s pretty neat!

So, my opinion? As far as a phone (or PDA) goes, I think that the G1 is pretty solid. I know that some reviewers claimed that they didn’t think it would really appeal to most people. However, I think that it will. It has a pretty slick interface and a lot of neat features. Additionally, I think the demographic it will appeal to most, is people like me – developers and people who like to play with neat gadgets. I know that once I get some more time on my hands, I’m going to try and develop stuff on it. iPhone killer? I don’t know. But I think the G1’s strength is that it is completely open. In effect, it is the antithesis to the iPhone, or the anti-iPhone. Google doesn’t control the G1 (or Android) as strictly as Apple controls the iPhone, and especially with regard to the SDK. Google seems to want to encourage developers whereas Apple seems to want to encourage them only as long as they play by Apple’s rules. Consider also the fact that if you do want to develop for the iPhone, you can only do it on a Mac. Whereas you can develop apps that will run on Android on Windows, Mac, or Linux. I guess we’ll have to wait and see. But for now, I’m just happy to have a cool new toy er… I mean, phone!

Update

I’ve noticed a lot of queries to this blog post regarding the importing of SIM contacts into the G1. The process is quite simple:

  • Swipe the dock at the bottom of the screen upwards to access the G1’s menu.
  • Select Contacts from the menu.
  • Hit the Menu button and then select Settings
  • You should now see “Sync Groups” and “SIM contacts importer”
  • Select SIM contacts importer. You should now be able to import your contacts.
  • If you want to import them all in one go, hit Menu and then select Import all

As a general rule, if you’re having trouble finding (extra) options, hit the Menu button. It should show you a few more options.

The G1's outer box
The G1’s outer box

The G1's inner box
The G1’s inner box

The G1 inside the box
The G1 inside the box

The G1's accessories and manuals
The G1’s accessories and manuals. The accessories you get are a carrying case, battery, headphones, USB cable, and charger. Oh, and you get a SIM card too (if you ordered through T-Mobile’s website)

The G1 inside the box
The G1 inside the box

The T-Mobile Android G1
The T-Mobile Android G1

G1 side view
G1 side view

G1 keyboard flipped out
G1 keyboard flipped out

G1 home screen
G1 keyboard flipped out

G1 menu
G1 menu

G1 dialer
G1 dialer

G1 displaying Google Maps
G1 displaying Google Maps

G1 displaying Google Maps (side view)
G1 displaying Google Maps (side view)

G1 displaying Google Maps Satellite View (side view)
G1 displaying Google Maps Phoenix Satellite View (side view)

G1 displaying Google Maps Street View
G1 displaying Google Maps Street View

G1 vivin.net
G1 displaying vivin.net

The G1 in its case
The G1 in its case

All original content on these pages is fingerprinted and certified by Digiprove
%d bloggers like this: