Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Apr 2006 08:29:37 +1000
From:      Andrew Reilly <andrew-freebsd@areilly.bpc-users.org>
To:        freebsd-java@freebsd.org
Subject:   Amazing: Sun's NetBeans Mobility pack works on my FreeBSD box
Message-ID:  <20060408222937.GA4711@gurney.reilly.home>

next in thread | raw e-mail | index | archive | help
I can't contain my excitement, and thought that there might be
folk on the list who would care to know this too.  This
will also commit the recipe to my Sent mail repository, should I
ever need it again...

Background: surprising as it may seem, until fairly recently,
the only way to develop JavaME (micro edition) MIDP applications
to run on, say, smart phones, was to use a Windows box.  The
reason for that, apparently, was that Sun contracted-out the job
of building a little phone work-alike GUI to use as an
"emulator" to debug applications, and this resulted in a
windows-only binary.  Weirdly, this meant that you couldn't even
install the libraries and other dev tools on anything else,
either.  This was a bummer for me, because I have a shiny new
Java capable pda/phone, but no Windows boxes.

Several things have now changed this: (1) FreeBSD has a
fully-compliant JDK1.5, which is available in binary form for
ia32 machines, but compiles nicely from source for AMD64 (I
upgraded this afternoon); (2) Neteans-5.0 runs fine on this, and
ports has been updated to install this version, recently; (3)
Sun seem to have released a Linux version of the Mobility Pack
Netbeans plug-in and lo: with hardly any effort, this runs just
fine on my FreeBSD box (which has linux emulation installed:
that's necessary to bootstrap the JDK build anyway).

Before I forget, here's what I had to do to build and run the
hello-world demo:

* Fire up NetBeans5.0, and notice that there's a "Mobility Pack"
  frob on the welcome screen.  Click that frob.

* That will fire up mozilla (not firefox or epiphany,
  surprisingly---must have the name config'd in somewhere) and
  take you to the download page.  Download the linux mobility
  pack .bin file (netbeans_mobility-5_0-linux.bin).

* This is a bourne-shell script that does some weird in-place
  unpacking and execution malarky.  chmod +x it, and run it with
  /usr/compat/linux/bin/sh, as root (!).  It will pop up a
  window because it can't find your netbeans installation.  Use
  the browse button to point it to /usr/local/netbeans, which is
  where the port put it.  It will then install itself as a
  Netbeans plugin.

* Fire up netbeans as yourself, and follow the mobility quick
  start links, or use file new... to create a starter mobility
  proejct.

This is where you'll run into the snag that requires a bit of
fiddling.  When netbeans started, it unpacked a bunch of stuff
into ~/.netbeans/5.0/emulators/wtk22_linux/emulator/wtk22/.
The stuff in bin is shared objects, bourne shell scripts and
Linux ELF ia32 executables.  The bourne shell scripts and the
linux executables need to be chmod +x'd.  That will let netbeans
run them, but it won't be happy, because it can't find
~/.netbeans/5.0/emulators/wtk22_linux/emulator/wtk22/wtklib/FreeBSD/ktools.prope+rties.
Copy the Linux/ktools.properties directory and file to FreeBSD,
and everything will (hopefully) magically work.

Neat, huh?

Huge thanks to Greg Lewis and the other FreeBSD Java
folk...

-- 
Andrew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060408222937.GA4711>