0
votes

I am trying to use the library scala-io in my Eclipse environment, does anyone know how do I generate a jar file, or which folder to include in my eclipse so that I can have access to the scala-io library from my project ?

EDIT: Q: How to incorporate an external library into scala IDE? A: Two possibilities:

  1. Leverage SBT to build your project; that is generating jar files and maintaining dependency
  2. Including the generted jar files directory in the IDE, project -> Properties -> Java build paths.

hth.

EDIT #2: I found this great plugin to generate all of your dependencies in one jar file sbt-assembly

1
When I create a new Scala project in the Scala IDE the scala.io package is included by virtue of the Scala Library it includes. If you have regular Eclipse, you can make a Scala library or even just add the jars under the project's libraries tab. Once you have the library/jars, just use a normal scala import statment. If you have Scala installed on your computer, it should come with the jars you would add. The Scala IDE ships with it's own jars and I'm just using those.n0741337
When imputing scalar.io I got an error saying that tne package is nit recognized, that is why I am trying to find out how to import the jar file.CruncherBigData
I didn't examine the scala-io link carefully enough and thought you referring to the core scala-io classes. You can use a build tool like @Ido Tamir suggests or grab the jars from the link he provided directly under the "Manual Download Example".n0741337
thanks @n0741337 I just reformatted the question and the answer.CruncherBigData

1 Answers

1
votes

http://jesseeichar.github.io/scala-io-doc/0.4.2/index.html#!/getting-started shows how to start with sbt or maven or with prebuild jars provided by links.

You should try to get familiar with a build system like sbt. Its cumbersome to always manually add dependencies to eclipse, especially if you have dependency chains: scala-io needs scala-io-core and arm and file etc...