How can I obtain an interactive shell (like Ruby's irb) for Java?

BeanShell is probably what you're looking for.

https://github.com/beanshell/beanshell


There are a few choices: BeanShell has been around for a long time, and is a great Java REPL.

Another alternative is groovy's groovysh or groovyConsole. While groovy isn't Java in the strict sense, it's great for interactively playing around with Java classes.


Would "Use an Eclipse Java Scrapbook page" be better ;-)

I haven't actually used irb, but if you just want to run code snippets inside of eclipse, then this is a simple way of doing it.

Tags:

Java

Ruby

Irb