I am trying to use the BGGA closures prototype with an existing JDK 6 (standard on Mac OS X Leopard). The sample code I'm compiling is from a BGGA tutorial:
public static void main(String[] args) {
// function with no arguments; return value is always 42
int answer = { => 42 }.invoke();
System.out.println(answer);
}
I have tried the following, and none work:
- Copied closures.jar to /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/lib
- Ran javac with -Xbootclasspath/a:/path/to/closures.jar
- Ran javac with -J-Xbootclasspath/a:/path/to/closures.jar
- Tried from eclipse ganymede by defining my own system library and attaching it to my project with code utilizing BGGA.
In all four cases, I get compilation errors, indicating that the compiler did not pick up closures.jar on the bootstrap classpath. I'd really like to get this working from eclipse, or at the very least maven. Thanks!