Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command prompt that knows Java? [duplicate]

Possible Duplicate:
Java REPL shell

Is there a project that makes a command prompt that can execute Java statements? Why not? I'm looking for something like the builtin shell of Python but for Java.

I see there is http://www.beanshell.org/ but that project does not seem very active. But it appears to be what I'm looking for. Are there any other projects like this?

I want to be able to do something like this

$ import org.foobar.Bletch

$ new Bletch();

or similar. Has anyone done this?

like image 568
Niklas Rosencrantz Avatar asked Feb 19 '23 10:02

Niklas Rosencrantz


1 Answers

You could always use a Clojure REPL - I do this for dynamically playing with Java objects at runtime.

(import 'my.package.SomeClass)

(def a (new SomeClass))

(.methodName a arg1 arg2)

Works pretty well as long as you know the Clojure syntax.

like image 74
mikera Avatar answered Feb 27 '23 06:02

mikera