Is there something like python's interactive REPL mode, but for Java?

Yoni Roit picture Yoni Roit · Dec 29, 2008 · Viewed 22.3k times · Source

Is there something like python's interactive REPL mode, but for Java? So that I can, for example, type InetAddress.getAllByName( localHostName ) in a window, and immediately get results, without all this public static void nightmare() thing?

Answer

OscarRyz picture OscarRyz · Dec 29, 2008

edit Since Java 9 there's JShell

Original answer follows

You can also use Groovy Console. It is an interactive console where you can do what you want. Since Groovy also includes classes from the core java platform, you'll be able to use those classes as well.

It looks like this:

Screenshot of Groovy