Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRB doesn't start on jRuby 9.1.16.0 #5104

Closed
raelik opened this issue Mar 22, 2018 · 8 comments
Closed

IRB doesn't start on jRuby 9.1.16.0 #5104

raelik opened this issue Mar 22, 2018 · 8 comments

Comments

@raelik
Copy link

raelik commented Mar 22, 2018

Environment

Behavior

Trying to run irb raises an exception: java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected, full stack trace is here: https://gist.github.com/raelik/f8e73b2ab46b46b3fcde231d4fc0cbdb

This error doesn't occur on 9.1.15.0 and prior.

@headius
Copy link
Member

headius commented Mar 22, 2018

Are you certain you're not mixing environments? We addressed this issue during 9.1.16.0 cycle, but if you have 9.1.16.0 for whatever reason picking up 9.1.15.0's gems it might still happen.

@raelik
Copy link
Author

raelik commented Mar 22, 2018

I'm using the jruby-gradle-plugin to build an artifact jar containing jruby and all of my gems, and I blow it away and rebuild it from scratch.

@headius
Copy link
Member

headius commented Mar 22, 2018

@mkristian Any idea why this would still be happening?

@headius headius added this to the JRuby 9.1.17.0 milestone Mar 22, 2018
@raelik
Copy link
Author

raelik commented Mar 22, 2018

Just looking at the stack trace, the only way I can see this happening if somehow jline 2.x was somehow being loaded. That's when jline.Terminal was implemented as an interface.

@raelik
Copy link
Author

raelik commented Mar 22, 2018

@headius That's exactly what's happening. Here's a the result of running jar -tvf | grep jline on my jar built for 9.1.16.0:

     0 Wed Feb 21 10:21:44 CST 2018 META-INF/jruby.home/lib/ruby/stdlib/jline/
    11 Wed Feb 21 10:20:46 CST 2018 META-INF/jruby.home/lib/ruby/stdlib/jline/.jrubydir
     0 Wed Feb 21 10:21:44 CST 2018 META-INF/jruby.home/lib/ruby/stdlib/jline/jline/
    35 Wed Feb 21 10:20:46 CST 2018 META-INF/jruby.home/lib/ruby/stdlib/jline/jline/.jrubydir
     0 Wed Feb 21 10:21:44 CST 2018 META-INF/jruby.home/lib/ruby/stdlib/jline/jline/2.11/
    20 Wed Feb 21 10:20:46 CST 2018 META-INF/jruby.home/lib/ruby/stdlib/jline/jline/2.11/.jrubydir
208781 Wed Feb 21 10:20:46 CST 2018 META-INF/jruby.home/lib/ruby/stdlib/jline/jline/2.11/jline-2.11.jar
   288 Wed Feb 21 10:20:46 CST 2018 META-INF/jruby.home/lib/ruby/stdlib/jline/jline/maven-metadata-local.xml
     0 Thu Mar 22 14:09:52 CDT 2018 jars/jline/
     0 Thu Mar 22 14:09:52 CDT 2018 jars/jline/jline/
     0 Thu Mar 22 14:09:52 CDT 2018 jars/jline/jline/0.9.94/
 87325 Thu Mar 22 14:09:52 CDT 2018 jars/jline/jline/0.9.94/jline-0.9.94.jar

Here it is for 9.1.15.0:

     0 Thu Mar 22 14:32:42 CDT 2018 jars/jline/
     0 Thu Mar 22 14:32:42 CDT 2018 jars/jline/jline/
     0 Thu Mar 22 14:32:42 CDT 2018 jars/jline/jline/0.9.94/
 87325 Thu Mar 22 14:32:42 CDT 2018 jars/jline/jline/0.9.94/jline-0.9.94.jar

@raelik
Copy link
Author

raelik commented Mar 22, 2018

I tracked down the problem, not sure how to resolve it. My project uses Apache Curator 2.x, which depends on ZooKeeper 3.4.8... which depends on jline 0.9.94. Luckily, none of my code touches any parts of ZK that depend on jline (most likely command-line utilities).

@raelik
Copy link
Author

raelik commented Mar 22, 2018

Ok, I was able to fix this by excluding jline from my runtime configuration in my build.gradle. Nothing to see here, move along!

@raelik raelik closed this as completed Mar 22, 2018
@mkristian
Copy link
Member

great this got resolved. this exactly the reason we try to get rid of jline altogether in jruby.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants