Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

ruby

irb

I spent the last year doing Ruby development, and during that time I discovered irb, which makes running little "code experiments" easy and fun. I've recently switched teams and am now doing Java development, and I've found that I really miss my irb window. I would like to do the same thing for Java, but I don't know how.

I'm using Eclipse (groan), but Eclipse's bells and whistles are not the same thing.

like image 345
Dan Barowy Avatar asked May 20 '11 18:05

Dan Barowy


2 Answers

BeanShell is probably what you're looking for.

https://github.com/beanshell/beanshell

like image 152
Austin Taylor Avatar answered Sep 20 '22 16:09

Austin Taylor


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.

like image 43
ataylor Avatar answered Sep 18 '22 16:09

ataylor