Seems like this should be simple, but I'm not a java guy. I was going to try and use the apache commons ftp component (org.apache.commons.net.ftp), but I don't know how to make it accessible to my scala code.

At the moment, I've just tried dropping the package into a directory, starting the scala repl from that directory, and issued: import org.apache.commons.* I'm told that apache is not a member of package org, which I assume to mean it can't find the code.

This really seems like it ought to be easy, but any suggestions would be appreciated.

有帮助吗?

解决方案

You need to add the jar into the class path. From REPL, that is done like so:

scala -classpath some.jar

If you are building a project, you might want to consider using a build tool like sbt (http://www.scala-sbt.org/) which allows you to specify dependencies.

其他提示

With SBT, you would put into your build.sbt

libraryDependencies += "commons-net" % "commons-net" % "3.2"

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top