문제

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