Interactive (but small) shell for Java

I am looking for an interactive shell in which I can insert a Java application for use in debugging and scripting. I'm not terribly interested in writing Java scripts, so a more shell-like syntax would be great, but I would like to be able to load and run "external commands" on the fly (these would be Java.class files).

Unfortunately, my platform is very limited in space - double-digit megabytes of heap. As languages ​​like Groovy, Jython and JRuby are unsuitable.

I found BeanShell that looks good, but it looks like it has been dead for years, and the syntax is rather cumbersome to use on the command line - for example. it would be nice to have things like "help" typing an error message rather than silence.

Are there any other systems I should look at?

Edit: ... aaaaand I just discovered that BeanShell2 requires reflection capabilities that my platform does not have, and even RetroWeaver cannot help me with this. I will try BeanShell 1, but I'm not sure.

+4
source share
3 answers

You can watch Rhino .

Rhino is an open source JavaScript implementation entirely written in Java. It is usually embedded in Java applications to provide end-user scripting. It is built into J2SE 6 as the default Java scripting engine.

+2
source

beanShell is just fine. This is done, not dead. And there seems to be a beanshell 2.0 branch.

+3
source

Cliche can expose custom methods that can be called at run time.

+1
source

Source: https://habr.com/ru/post/1347306/


All Articles