You can run a scala script as a linux shell script:
#!/bin/sh
exec scala "$0" "$@"
!#
println("Hello")
In one such script I need to load classes from a group of jars (which happen to be in the same directory as the script). If this were the REPL I could use :jar, but that's not available in script mode.
I'm trying to set the -classpath parameter:
#!/bin/sh
exec scala -classpath '.:./*.jar' "$0" "$@"
!#
import javax.media.jai.{JAI, RenderedOp}
but the compiler just can't find the classes:
error: object media is not a member of package javax
import javax.media.jai.{JAI, RenderedOp}
^
How do I include these jars?
'will prevent glob expansion, so it will look for a file named*.jar.