views:

719

answers:

2

Is it possible to include a jar file run running the Scala interpreter?

My code is working when I compile from scalac:

scalac script.scala -classpath *.jar

But I would like to be able to include a jar file when running the interpreter.

+2  A: 

In scala2.8,you can use

scala>:jar JarName.jar

to add a jar to the classpath.

Eastsun
+2  A: 

According to scala executable help all options of scalac are allowed , so you can run scala -classpath some.jar, i've just tried and it looks like it works

Nikolay Ivanov