I'm a newbie to Mac OS X, I come from a world where I always have the latest jdk installed (OpenSolaris, SXDE), or if I don't (Solaris 10) I just add it using what amounts to muscle memory. Then I move to Mac OS X and twice now I've tried to run Java code that uses JSR-223 (Scripting) and both times it's not worked. It's only because it's ingrained that it should just work that I was able to do ithe same thing twice in two days. So today I installed the Developer Preview 9 of Java SE 6 for Mac OS X. It works so far but why can't it just install in /usr/java? Where it is installed it doesn't even have a bin directory, instead it has "Commands", how posh.
Anyway, I aliased the java and javac commands to point to their 1.6 counterparts and so far it works fine. Later I tried to run NetBeans with jMaki. After installing the plugin I created a new Web App with jMaki support and it hung at 75%. Being a firm believer that doing the same thing over and over and expecting a different result (the idiot approach) is the safest bet these days, I did it twice and got the same result. Then I noticed that it threw an UnsupportedClassVersionError which is never a good sign. So I modified the netbeans.conf to use the Java SE 1.6 DP and it worked fine.
This is the problem with using 3 OSes. I use various versions of Solaris to do all of my serious work, Windows at home so that I can play games and Mac OS X on my laptop. I gave up doing any kind of programming on Windows ages ago, mainly because i-t-s-n-o-t-u-n-i-x. At least Mac OS X feels like Unix so maybe there's hope. Apple, don't be afraid to provide symlinks in /usr to stuff and 'bin' is a perfectly adequate name for a directory that stores executables.
BTW: I know that Mac OS X is based on BSD which is goodness, I just don't think that it's mum would recognise it