質問

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