Posted by felipeal
on March 8, 2006 at 9:36 PM PST
After struggling for a desnecessary while (and they said Mac OS X is the better platform for Java developers...) I've figured out how to install NetBeans 5.5 Enterprise Preview on Mac OS X...
I'm writing the web services material for Globalcode 's brand new course on Java Enterprise development, so I decided to give NetBeans 5.5 Preview/Glassfish a try (after all, WS with annotations is one of the ease-of-development promisses of Java EE 5).
Currently, I have 2 systems: a Pentium III Linux desktop and a G4 Powerbook; I'm trying to use the Powerbook as primary development machine, so I went to NetBeans' site but for my (not so) surprise, there was no Mac OS X version (as there is no Mustang build as well...); OTOH, the release notes (http://www.netbeans.org/community/releases/55/relnotes.html ) said:
NetBeans Enterprise Pack is also known to run on the following platforms:
*some unmentionable OS*
Solarisâ„¢ 8 OS (SPARC and x86/x64 Platform Edition) and Solaris 9 OS (SPARC and x86/x64 Platform Edition)
Mac OS X 10.4
Various other Linux distributions
The problem and its solution
Well, when something is 'also know to run' on something not supported and the Release Notes doesn't say how, you gotta feel lucky. So, googling for it, I found a blog where the guy managed to extract the files from the Linux version, but got a NoClassDefFoundError exception when running the script; I followed the same steps, got the same error and so decided to figure it out how to do it...
So, after changing the shell scripts (putting an echo here and an exit there), I found the problem: all the jars were not there as .jar, but saved as xxx.unpack.jar.gz. My first reaction was to google for unpack.jar.gz, but no lucky feelings this time. Fortunately though, thanks to G(nu)od, I typed 'unpack' + TAB, and realized there was an 'unpack200' on my path (which I then realized is a Sun's utility to handle the new JAR format, defined in some JSR and included on Tiger).
After a few more minutes of shell scripting (hint to whoever is responsible to the unpack tool: it should optionally take just one file as input and extract the jar names as input-pack.gz...), I came to the solution:
for i in `find . -name *.pack.gz|xargs`;
unpack200 $i `echo $i | sed â€™s/\(.*\).pack.gz/\1/gâ€™`;
Once you run that for command, you're done - all you have to do is running netbeans from the bin directory.
* After spending about 2.5 hours solving a problem that I shouldn't and blogging about it, I got the application running (and the delivery of the web services material 1 day delayed, as it's past 2AM now and I won't be able to test it - I can barely write the blog in a decent English... :-(
* This is not the first issue I had with Java/Mac OS since I bought my Powerbook (on last year's JavaOne) - I had trouble running almost any Java application (mevenide, maven continuum, some eclipse plugins and others that I don't remember), not to mention stuff that takes a while to be supported (like Tigger, NetBeans Profiler and Mustang).
* There's been a lot propaganda (not only by companies, but also from developers) that Mac is the perfect Java development platform, but I have to disagree, due to all these issues. Some people blame Apple, others Sun, others Eclipse or whatever project, but I - as developer - don't care: I think these companies (specially Apple) are missing a window of opportunity here (I wouldn't be surprised if someone created a 'switch' page relating stories of people migrating from Mac OS to Linux - there's been some blogs about it here at java.net already, but I'm too sleepy to search them for a link).
* Sorry for the sarcasm, but I should really being sleeping (after doing some real work on the material :-( by now...
* No Hani , I don't work for NetBeans neither Glassfish (not that I wouldn't like to...)
* And finally: did I mention Mustang is not available on Mac OS X yet?