Frage

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.

War es hilfreich?

Lösung

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.

Andere Tipps

With SBT, you would put into your build.sbt

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top