Well I know it is a stupid question, but lets think on it for a second.
Why can't we have a repl mode or kind of a shell for Java. Say I just want to do Math.max(2,3) to get output 3. It can be similar to Scala repl mode, where by default the class and main declarations are handled (it extends to App) and only an expression is evaluated.
Technically:
javac can be a bit modified for such casesIt would be cool to have a default shell for each JVM process, where on the run, one can access or set some say static variables and have live information.
All this would have been thought off, but why hasn't it been accepted by majority (there are some open source implementations though)
This is more or less exactly what BeanShell does.
The Display view in Eclipse provides a lot of convenient behaviour in this area, with command completion, access to the running application stack, and console output through System.out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With