How a Scala script can specify what JARs should be added to its CLASSPATH


/ Published in: Scala
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #!/bin/sh
  2. L=`dirname $0`/../lib
  3. cp=`echo $L/*.jar|sed 's/ /:/g'`
  4. exec scala -classpath $cp $0 $@
  5. !#
  6. import com.my.special.World
  7. val world = new World
  8. world.hello

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.