Hmm, I think you've found a hole in a fix I made for 1.6.1.
Before 1.6, we attempted to guess the package name from the directory structure. If the directory structure contained characters that could not be mapped into a package name, we had to mangle those characters. This caused the .class files to be emitted into mangled directories, the class they contain to have a mangled package, and so on. This in turn caused applications with package-unfriendly characters to be nearly impossible to precompile.
My fix was to make jrubyc's normal mode always emit the class as a SHA1 hashed name contained in a .class file named exactly the same as the script. JRuby's loader can handle that case and load the contained class using the appropriate SHA1 name.
When I first started working on the JRuby AOT compiler (jrubyc) I knew that the resulting .class files would always be a little weird. They're not really a normal Java class that can be instantiated, reflected, invoked. In general I have discouraged treating jrubyc-compiled Ruby scripts as Java classes. I ALMOST made a change to have jrubyc emit files with the extension .rb.class to indicate that they're vaguely JVM class-like, but not intended to be used directly as Java classes. This idea was to address folks like you using those class files directly.
I regret the lost of a simple "main" being in the classes, but the compiled results of jrubyc have never really been intended to look like "real" Java classes. That feature comes from jrubyc --java(c), where you could define a "main" class something like this:
java_signature 'void main(String)'
def self.main(args) # args is a Java String still
# call into your code as appropriate
In the simple case, this will emit a logstash/runner.class that mostly behaves like the "main" from JRuby 1.6.0 jrubyc. There are more complex cases illustrated here:
This mechanism is intended as the proper way to generate "real" Java classes. It should work with JRuby 1.6.x and probably all 1.5.x releases too.
Does this seem like an acceptable alternative for you guys?