Up until a commit yesterday, a "java_require" line was *required* in the file so it would know what .rb file to load to prepare your "MyRubyClass" on the Ruby side of things. But I committed a change yesterday so that if there's no java_require, it will actually produce a free-standing .class.
Can you give it a try with last night's build (or a current build from master)? http://ci.jruby.org/snapshots On Tue, Mar 16, 2010 at 10:29 AM, Ahmed Ragab Nabhan <anab...@uvm.edu> wrote: > Hi Developers, > > I have used the simple utility jrubyc that compiles a .rb file into .java. > When I try to run the resulting .class file, I got got an exception: > > $java -cp /.rvm/rubies/jruby-head/lib/jruby.jar:. MyRubyClass > > Exception in thread "main" java.lang.ExceptionInInitializerError > Caused by: java.lang.NullPointerException > at MyRubyClass.<clinit>(MyRubyClass.java:18) > > > 15: static { > 16: > 17: RubyClass metaclass = __ruby__.getClass("MyRubyClass"); > 18: metaclass.setClassAllocator(MyRubyClass.class); > 19: if (metaclass == null) throw new NoClassDefFoundError("Could not load > Ruby 20: class: MyRubyClass"); > 21: __metaclass__ = metaclass; > 22: } > > The problem is that the __ruby__.getClass("MyRubyClass") returns null. > > Any idea about what is going wrong? > > Thank you, > Ahmed Nabhan > > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email