I'm trying to install the prototype for JSR014 in Mac OS X, but I am having trouble with the $J2SE14 environment variable I am supposed to setup for the scripts to work. I set it to point to /System/Library/Frameworks/JavaVM.framework/Home/, but that directory doesn't seem to be good enough. The javac script given does the following check:
if [ ! -x ${J2SE14}/bin/javac -o ! -r ${J2SE14}/jre/lib/rt.jar ];
${J2SE14}/bin/javac does exist when I set my environment variable as stated above, but sadly there is no ${J2SE14/jre directory. In fact, I cannot seem to find any instance of an rt.jar on my system. Is this a file that doesn't get installed with Apple's J2SDK 1.4.1_01?
Yes, Apple split it up into /System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Classes/classes.jar and /ui.jar IIRC. You're certainly looking for classes.jar and ui.jar somewhere inside the JavaVM.framework.
So how can I make the scripts for JSR014 work with the Mac OS X setup? Does it really need an rt.jar? Should I combine classes.jar and ui.jar into an rt.jar somehow? Have you tried getting the JSR014 prototype working in OS X?
For some reason it doesn't seem to like the "implements" keyword in the middle of the angle brackets. Could the be a problem of my setup not quite matching yours, or am I missing something?
Hey, thanks for all the info in this thread; I'm trying to do the same thing (run the JSR014 stuff on OS X) but now I keep getting
javac: invalid source release: 1.5
In fact, I get that if I just try to run
javac -source 1.5
without any other command line arguments.
Is that because my current Java version is only up to 1.4.1_01?
Do I need 1.4.2 to compile with -source 1.5?
And if so, can I get 1.4.2 for Mac OS 10.2.6?
Thanks for the quick reply. In fact I was running (an altered version of) the script, but I had misconfigured my environment variables.
I'm still fuzzy on the meaning of the command line arguments to javac inside the script. What's the distinction between -bootclasspath, which allows you to "cross-compile against the specified set of boot classes" and -J-Xbootclasspath, which passes "-Xbootclasspath" "to the java launcher called by javac"? (Actually I think I've sort of answered my own question there, but any clarification would still be appreciated.)
javac is written in Java, thus it needs a java process in which to run.
-Xbootclasspath is passed to the instance of java running javac to tell it which bootclasspath to use. This implies this version of javac is itself already using generics or other 1.5 features internally.
-bootclasspath is specifying the clases to compile YOUR code against. This allows you to use 1.5 features in your code.