You can definitely do this via java -jar , but I think it will not be as simple as jython. For example, if you look at scala.bat (on windows) in a standard scala installation, you will see that it uses some variant of the following command:
"java" -Xmx256M -Xms32M -Dscala.home="C:\PROGRA~2\scala\bin\.." -Denv.emacs="" -Dscala.usejavacp=true -cp "C:\PROGRA~2\scala\bin\..\lib\jline.jar; C:\PROGRA~2\scala\bin\..\lib\scala-actors.jar; C:\PROGRA~2\scala\bin\..\lib\scala-compiler.jar; C:\PROGRA~2\scala\bin\..\lib\scala-library.jar; C:\PROGRA~2\scala\bin\..\lib\scala-partest.jar; C:\PROGRA~2\scala\bin\..\lib\scala-reflect.jar; C:\PROGRA~2\scala\bin\..\lib\scala-swing.jar; C:\PROGRA~2\scala\bin\..\lib\scalacheck.jar; C:\PROGRA~2\scala\bin\..\lib\scalap.jar" scala.tools.nsc.MainGenericRunner
All on one line, of course. I made cd in the scala installation directory and then in the bin folder and executed this command directly. This gave me scala repl.
I assume that you can probably skip some of the jars (swings, actors, etc.), combine the others into one jar and get rid of some command line options, and then discard it using java -jar myscala.jar
PS: If you are trying to do something with Android, beware that this will not work. Because I tried this before: Scala REPL in Android app
: D
source share