So I have Java 7 (64bit Windows build 84) and NetBeans 6.8. I want to use the new invokedynamic
stuff in Java 7 and compile from NetBeans but I can't figure out how to get NetBeans to run the program with the right options except when I build it (run fails, build works).
The code needs to be compiled with the option -XDinvokedynamic
and run with -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles -XX:+EnableInvokeDynamic
. So, in the Project Properties dialogue, I change the Additional Compiler Options in Build to include -XDinvokedynamic
but that only affects the build not when I click run.
I believe adding the -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles -XX:+EnableInvokeDynamic
options to the VM Options box in Run works correctly though (although I can't be sure).
So, simply how can I get NetBeans to use compile with -XDinvokedynamic
whether I'm building or just running it?