Ankur
Ankur

Reputation: 77

java.lang.RuntimeException: could not find scala-library.jar

I have a play project which is built using java 1.7, Play 2.2.0 & I am trying to create Eclipse project files for my project using following commands:

 F:\Projects\test>play

 [test] $ clean

 [test] $ compile     

 [test] $ eclipse with-source=true   

But it is throwing following error: -

java.lang.RuntimeException: could not find scala-library.jar
        at play.PlayEclipse$$anon$7$$anonfun$createTransformer$3$$anonfun$3.apply(PlayEclipse.scala:80)
        at play.PlayEclipse$$anon$7$$anonfun$createTransformer$3$$anonfun$3.apply(PlayEclipse.scala:80)
        at scala.Option.getOrElse(Option.scala:120)
        at play.PlayEclipse$$anon$7$$anonfun$createTransformer$3.apply(PlayEclipse.scala:80)
        at play.PlayEclipse$$anon$7$$anonfun$createTransformer$3.apply(PlayEclipse.scala:79)
        at scalaz.Validation$class.map(Validation.scala:114)
        at scalaz.Success.map(Validation.scala:343)
        at play.PlayEclipse$$anon$7.createTransformer(PlayEclipse.scala:79)
        at com.typesafe.sbteclipse.core.Eclipse$$anonfun$5$$anonfun$apply$4$$anonfun$6.apply(Eclipse.scala:120)
        at com.typesafe.sbteclipse.core.Eclipse$$anonfun$5$$anonfun$apply$4$$anonfun$6.apply(Eclipse.scala:120)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
        at scala.collection.immutable.List.foreach(List.scala:318)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
        at scala.collection.AbstractTraversable.map(Traversable.scala:105)
        at com.typesafe.sbteclipse.core.Eclipse$$anonfun$5$$anonfun$apply$4.apply(Eclipse.scala:120)
        at com.typesafe.sbteclipse.core.Eclipse$$anonfun$5$$anonfun$apply$4.apply(Eclipse.scala:116)
        at scala.Option$WithFilter.map(Option.scala:206)
        at com.typesafe.sbteclipse.core.Eclipse$$anonfun$5.apply(Eclipse.scala:116)
        at com.typesafe.sbteclipse.core.Eclipse$$anonfun$5.apply(Eclipse.scala:115)
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
        at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
        at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
        at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
        at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
        at com.typesafe.sbteclipse.core.Eclipse$.handleProjects(Eclipse.scala:115)
        at com.typesafe.sbteclipse.core.Eclipse$.action(Eclipse.scala:101)
        at com.typesafe.sbteclipse.core.Eclipse$$anonfun$eclipseCommand$2.apply(Eclipse.scala:82)
        at com.typesafe.sbteclipse.core.Eclipse$$anonfun$eclipseCommand$2.apply(Eclipse.scala:82)
        at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:60)
        at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:60)
        at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:62)
        at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:62)
        at sbt.Command$.process(Command.scala:95)
        at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:87)
        at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:87)
        at sbt.State$$anon$1.process(State.scala:176)
        at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:87)
        at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:87)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
        at sbt.MainLoop$.next(MainLoop.scala:87)
        at sbt.MainLoop$.run(MainLoop.scala:80)
        at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:69)
        at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:66)
        at sbt.Using.apply(Using.scala:25)
        at sbt.MainLoop$.runWithNewLog(MainLoop.scala:66)
        at sbt.MainLoop$.runAndClearLast(MainLoop.scala:49)
        at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:33)
        at sbt.MainLoop$.runLogged(MainLoop.scala:25)
        at sbt.xMain.run(Main.scala:26)
        at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:57)
        at xsbt.boot.Launch$.withContextLoader(Launch.scala:77)
        at xsbt.boot.Launch$.run(Launch.scala:57)
        at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:45)
        at xsbt.boot.Launch$.launch(Launch.scala:65)
        at xsbt.boot.Launch$.apply(Launch.scala:16)
        at xsbt.boot.Boot$.runImpl(Boot.scala:32)
        at xsbt.boot.Boot$.main(Boot.scala:21)
        at xsbt.boot.Boot.main(Boot.scala)
[error] could not find scala-library.jar
[error] Use 'last' for the full log.

Upvotes: 2

Views: 4546

Answers (4)

Kal
Kal

Reputation: 24910

I ran into this issue and it seemed to have to do with webjars.

Adding an exclude worked.

"org.webjars" %% "webjars-play" % "2.2.1" exclude("org.scala-lang", "scala-library")

More here :- https://github.com/webjars/webjars-play/issues/27

Upvotes: 0

Volodymyr Krupach
Volodymyr Krupach

Reputation: 918

I hit the same error. Tha cause was that in plugins.sbt I had:

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1")

While dependent module (one that I have in Build.scala, appDependencies) had:

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.2")

Correcting to 2.2.2 resolved the error.

My play is still version 2.2.1 and I get:

This project uses Play 2.2.2!
Update the Play sbt-plugin version to 2.2.1 (usually in project/plugins.sbt)

But it works for now and I'm too laze to update :-)

Upvotes: 2

caynan
caynan

Reputation: 139

Could you verify what is the version of the Play Framework you're using, also verify if it matches the one on your 'plugins.sbt' at:

    /project/plugins.sbt

it should be like this:

    addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.2") 

this is a know issue with the Play 2.2.2, but it seems to be already resolved.

Upvotes: 1

jmail
jmail

Reputation: 6134

I think you should not add the scala-library.jar as you should following the method to use these as:

The first time that Forge runs it needs to download a bunch of code libraries that match your system. One of these is failing to download for some reason, and it's required for Forge to run. I can download it in my browser though, so whatever is preventing Forge from downloading it automatically isn't preventing me from downloading it manually.

So here's how you may be able to fix it:

  1. Download the library manually. (That's the same link as in the error message in your question.)

  2. This will download a file named scala-library-2.10.2.jar. Save it somewhere where you can find it again.

  3. Open your .minecraft folder, then navigate to libraries → org.

  4. Inside the org folder, create the folder scala-lang.

  5. Open the new scala-lang folder and create the folder scala-library inside it.

  6. Open the new scala-library and create the folder 2.10.2 inside it.

  7. Open the new 2.10.2 folder. Find scala-library-2.10.2.jar wherever you saved it in step (1), and put it inside 2.10.2.

  8. Now double-check that all the folders are named exactly as above, with no extra letters, and no spaces before or after each folder name. Any errors will prevent the next step from working. Fix any naming errors you find before moving on.

  9. Run the launcher and start Forge. When it gets to the point where it used to try downloading Scala, it should find the library you just manually installed and keep going.

Upvotes: 0

Related Questions