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
"lib/*.jar" generates a list with blank between items not ":" or ";" as required. Since Java 6 "lib/*" should work, but sometimes doesn't (classpath is set somewhere else)
I use a script like:
Windows:
@rem all *.jars in lib subdirectory
@echo off
set clp=.
for %%c in (lib\*.jar) do call :Setclasspath %%c
echo The classpath is %clp%
scala -classpath %clp% script.scala
exit /B %ERRORLEVEL%
:Setclasspath
set clp=%clp%;%~1
exit /B 0
Linux:
#!/bin/bash
#all *.jars in lib subdirectory
clp="."
for file in lib/*
do
clp="$clp:$file"
done
echo $clp
scala -classpath $clp script.scala