problems getting an invoke dynamic sample compiled & running
John Rose
John.Rose at Sun.COM
Sat Nov 28 21:50:08 PST 2009
What build of openjdk are you using? There is a version mismatch in
the current build between the vm and rt.jar. It's an eng process bug;
sorry. For now use M3 (javaone prevw) or build the mlvm patches.
-- John (on my iPhone)
On Nov 28, 2009, at 1:03 AM, Alexandru Nedelcu <alex at lexoft.eu> wrote:
> Hi,
>
> I'm trying to compile the following code which uses MethodHandles:
> http://pastebin.com/m67d84d3c
>
> The compilation I did with ...
> /opt/java/jdk1.7.0/bin/javac -d bin/ src/Main.java
>
> When running it with no extra-params ...
>
> JSR 292 method handles are disabled in this JVM.
> Use -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles to
> enable.
>
> When adding the suggested options ...
>
> * JSR 292 method handle code is mismatched to this JVM. Disabling
> support.
> * Exception in thread "main" java.lang.NoSuchMethodError:
> java.dyn.MethodHandle.invoke(Ljava/lang/String;)V
>
> When adding -XX:+EnableInvokeDynamic the code runs, but I'm still
> getting this warning, which is not good I suppose ...
>
> * JSR 292 method handle code is mismatched to this JVM. Disabling
> support.
>
> Do you guys know of any document for getting this thing up and
> running?
>
> Thanks,
>
> --
> Alexandru Nedelcu
>
More information about the jdk7-dev
mailing list