Hi,
I’d like to compile jruby programs in to java classes and then execute
these classes directy on the jvm. I can’t seem to get it to work. Wwhat
am I missing?
C:\Users\steve>type test.rb
require ‘java’
puts “hi steve”
C:\Users\steve>jruby test.rb
hi steve
C:\Users\steve>jrubyc test.rb
Compiling test.rb to class test
C:\Users\steve>java test
Exception in thread “main” java.lang.NoClassDefFoundError:
org/jruby/ast/executa
ble/AbstractScript
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Caused by: java.lang.ClassNotFoundException:
org.jruby.ast.executable.AbstractSc
ript
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 12 more
Could not find the main class: test. Program will exit.