Skip to content

JRuby 1.7.5 doesn't compile valid class files #1136

rtyler opened this Issue Oct 16, 2013 · 5 comments

2 participants

rtyler commented Oct 16, 2013

I'm hoping this isn't a warbler-based bug, but given the stack trace, I'm assuming it has more to do with the JRuby 1.7.5 compiler.

Under 1.7.4 bundle exec warble jar:clean gemjar compiled runnable jar will create a properly runnable jar file.

Under 1.7.5, a jar-file will be created, but upon running it, the following exception will be raised:

-> % java -jar smb-full.jar -T
Exception in thread "main" java.lang.ClassFormatError: Extra bytes at the end of class file JarMain
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        at sun.launcher.LauncherHelper.checkAndLoadMain(

Looks like this issue might be the underlying reason for the exception.

FWIW, using:

-> % java -version
java version "1.7.0_40"
OpenJDK Runtime Environment (IcedTea 2.4.1) (suse-8.18.1-x86_64)
OpenJDK 64-Bit Server VM (build 24.0-b50, mixed mode)
JRuby Team member
headius commented Oct 21, 2013

Damn, I saw this issue once recently and can't remember what caused it. I'll investigate.

rtyler commented Oct 21, 2013

If there's anything you need help with in terms of hunting it down, find me on the IRC channel, I'll be around :)

JRuby Team member
headius commented Oct 22, 2013

If you can provide simple steps to build an app this way (I have not used this feature of warbler in a long time) I can try to reproduce here.

I did find a couple other JRuby issues indicating that conflicts with certain versions of the ASM bytecode library could be to blame.

Also this: jruby/warbler#196

And this one claims to fix the problem in warbler: jruby/warbler#197

rtyler commented Nov 7, 2013

@headius Unfortunately, besides giving you access to a proprietary codebase, I can't really reproduce this This does occur on 1.7.6 as well as 1.7.5 though

I'll try to run warbler from HEAD to see if it generates a good jar file.

rtyler commented Nov 13, 2013

As far as I can tell, this has been corrected as of warbler in 1.4.0 which was recently released.

@rtyler rtyler closed this Nov 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.