Re: [jruby-user] java.lang.invoke.SwitchPoint problem when using invokedynamic
Christian MICHON <[email protected]>
| Newsgroups | gmane.comp.lang.jruby.user |
|---|---|
| Message-ID | <CACx2yF_mu+92=-mkqZajETeq2MWXq9GYHKa3LXQF_NuN4vFQWg@mail.gmail.com> |
Isn't it because invokeddynamic is available for JDK8 and not JDK7? If you've the possibility to upgrade to JDK 1.8.0_11 and report back, you might see a different behavior. On Tue, Aug 19, 2014 at 9:08 PM, O. L. <[email protected]> wrote: > I'm using JRuby 1.7.13 and Java 7 to perform this task. Firstly, I use > "jrubyc" to compile a simple HelloWorld program into a Java class file > "hello.class". Next, I download the jruby library > "jruby-complete-1.7.13.jar" and execute the following command: > > java -cp .:jruby-complete-1.7.13.jar hello > > In the case when I disable the invokedynamic when doing the jrubyc, this > above command executes smoothly and prints out "hello, world!" without > problems. But if invokedynamic is enabled, the following exception > occurs: > > Exception in thread "main" java.lang.ClassCastException: > java.lang.Integer cannot be cast to java.lang.invoke.SwitchPoint > > at > > org.jruby.runtime.invokedynamic.InvocationLinker.invocationFallback(InvocationLinker.java:130) > > at hello.__file__(hello.rb:10) > > > I'm wondering what this "SwitchPoint" is and why it is causing problems. > I'm scanning through the jruby properties and see the following two > parameters that might be relevant: > > #invokedynamic.invocation.java=true > #invokedynamic.invocation.switchpoint=true > > But I've tried various ways attempting to change the value of these two > parameters but couldn't manage to do it. I'm also not sure if this is > the correct way of fixing the above exception. > > If anyone encounters this, please let me know how you work around with > it. I'm sure there're people who try to compile a Ruby file with the > latest JRuby version. > > -- > Posted via http://www.ruby-forum.com/. > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > -- Christian