Jruby error (wrong name: ruby/jit/FILE_D40BB14F6D953C9F0017A388A07364EC0E5B3F6E)
I am trying to compile a file using jrub开发者_Go百科y with the following commands but I have not had any luck.
jruby -S jrubyc test5.rb
java -cp .:/Users/Ted/.rvm/rubies/jruby-1.6.2/lib test5
I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: test5 (wrong name: ruby/jit/FILE_D40BB14F6D953C9F0017A388A07364EC0E5B3F6E)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:698)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
Ted
You need to package your class in a jar
file.
Also, your -cp
argument needs to specify an actual jar file (or zip) - it cannot refer to a directory as in your example.
精彩评论