Include jar file in Scala interpreter

后端 未结 7 1078
囚心锁ツ
囚心锁ツ 2020-12-28 14:54

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         


        
7条回答
  •  有刺的猬
    2020-12-28 15:20

    In scala2.8,you can use

    scala>:jar JarName.jar
    

    to add a jar to the classpath.

    In Scala 2.8.1, it is not :jar but :cp

    And in Scala 2.11.7 it is not :cp but :re(quire)

提交回复
热议问题