I saw people using play apis in the scala console. How can I import multiple play's jars to scala console?
https://stackoverflow.com/a/17684559/772481
I tried this command, but it didn't work.
$ scala -cp /usr/local/Cellar/play/2.2.0/libexec/repository/local/com.typesafe.play/play_2.10/2.2.0/jars/*.jar
@aleksey's answer works for me. I also find another way to do it.
Go to your project target folder
Now, run this command.
Your approach was right.
scala
REPL understands allscalac
options, soscala -cp
is the right option. However, you'll have to list all jars separately in the classpath separated by colon on Unix.If you are lazy like me and don't want to spell out all jar files you can use something like this to build the classpath:
Produces:
Use it in your original command:
If you want to avoid specifying a directory use
find
instead ofls
: