From owner-freebsd-java@FreeBSD.ORG Sat Apr 8 22:27:36 2006 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D38F16A452 for ; Sat, 8 Apr 2006 22:27:36 +0000 (UTC) (envelope-from andrew@areilly.bpc-users.org) Received: from omta01ps.mx.bigpond.com (omta01ps.mx.bigpond.com [144.140.82.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8435843D45 for ; Sat, 8 Apr 2006 22:27:34 +0000 (GMT) (envelope-from andrew@areilly.bpc-users.org) Received: from areilly.bpc-users.org ([141.168.4.160]) by omta01ps.mx.bigpond.com with ESMTP id <20060408222733.PRLQ19070.omta01ps.mx.bigpond.com@areilly.bpc-users.org> for ; Sat, 8 Apr 2006 22:27:33 +0000 Received: (qmail 4843 invoked by uid 501); 8 Apr 2006 22:29:37 -0000 Date: Sun, 9 Apr 2006 08:29:37 +1000 From: Andrew Reilly To: freebsd-java@freebsd.org Message-ID: <20060408222937.GA4711@gurney.reilly.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Subject: Amazing: Sun's NetBeans Mobility pack works on my FreeBSD box X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Apr 2006 22:27:36 -0000 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