Scala project doesn't compile anymore on Eclipse 4.4

1,484 views
Skip to first unread message

hol...@informatik.htw-dresden.de

unread,
Aug 20, 2014, 9:41:37 AM8/20/14
to scala-i...@googlegroups.com
I've upgraded Eclipse from 4.3 to 4.4 on Ubuntu. To start from fresh, I've also removed my .eclipse and installed the Scala IDE from http://download.scala-ide.org/sdk/lithium/e44/scala211/dev/site. I used this version as there's no information as to whether version 3.0.4 works with Eclipse 4.4.

I've cleaned my Scala project and started Eclipse with -clean. However, the code doesn't compile anymore because of the following problems:
  1. One of my packages uses import scala.swing._ This produces the error message
    object swing is not a member of package scala
  2. I use spire and scalaxy-loops. It seems that the 2.10 versions of these, which I have in my workspace, can't be used. Scala reports
    can't expand macros compiled by previous versions of Scala
I didn't change any of the default options for Scala.
build-path.png

Simon Schäfer

unread,
Aug 20, 2014, 10:17:57 AM8/20/14
to scala-i...@googlegroups.com

On 08/20/2014 03:41 PM, hol...@informatik.htw-dresden.de wrote:
I've upgraded Eclipse from 4.3 to 4.4 on Ubuntu. To start from fresh, I've also removed my .eclipse and installed the Scala IDE from http://download.scala-ide.org/sdk/lithium/e44/scala211/dev/site. I used this version as there's no information as to whether version 3.0.4 works with Eclipse 4.4.

I've cleaned my Scala project and started Eclipse with -clean. However, the code doesn't compile anymore because of the following problems:
  1. One of my packages uses import scala.swing._ This produces the error message
    object swing is not a member of package scala
scala.swing is no longer part of the Scala 2.11 library. You have to add it explicitly as a dependency.

  1. I use spire and scalaxy-loops. It seems that the 2.10 versions of these, which I have in my workspace, can't be used. Scala reports
    can't expand macros compiled by previous versions of Scala
You can't mix 2.10 libraries with Scala 2.11. Either upgrade your dependencies or configure a 2.10 library, as described here: http://scala-ide.org/blog/scala-installations.html
I didn't change any of the default options for Scala.
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/e999b3f5-59bf-473d-941c-137be3181aa6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

hol...@informatik.htw-dresden.de

unread,
Aug 20, 2014, 10:59:42 AM8/20/14
to scala-i...@googlegroups.com
Am Mittwoch, 20. August 2014 16:17:57 UTC+2 schrieb Simon Schäfer:

scala.swing is no longer part of the Scala 2.11 library. You have to add it explicitly as a dependency.
How do I add swing as a dependency using Eclipse and the Scala IDE? I don't see swing in the "add library" dialogue of the project properties.

Simon Schäfer

unread,
Aug 20, 2014, 11:18:19 AM8/20/14
to scala-i...@googlegroups.com
Use a build tool like sbt or download the library manually from the web and add it to your project.
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.

hol...@informatik.htw-dresden.de

unread,
Aug 20, 2014, 11:30:18 AM8/20/14
to scala-i...@googlegroups.com
Where do I find Scala Swing? A Google search found https://github.com/scala/scala-swing, but this is unmaintained.

Maybe I should downgrade to Scala 2.10 instead. Does http://downloads.typesafe.com/scalaide-pack/3.0.3.vfinal-210-20140327/scala-SDK-3.0.3-2.10-linux.gtk.x86_64.tar.gz work for Eclipse 4.4?

Simon Schäfer

unread,
Aug 20, 2014, 12:15:34 PM8/20/14
to scala-i...@googlegroups.com

On 08/20/2014 05:30 PM, hol...@informatik.htw-dresden.de wrote:
Where do I find Scala Swing? A Google search found https://github.com/scala/scala-swing, but this is unmaintained.
http://search.maven.org/#search|gav|1|g%3A%22org.scala-lang%22%20AND%20a%3A%22scala-swing%22

In order to add it to sbt if you want to use that: http://stackoverflow.com/questions/9025122/whats-wrong-with-my-scala-swing


Maybe I should downgrade to Scala 2.10 instead. Does http://downloads.typesafe.com/scalaide-pack/3.0.3.vfinal-210-20140327/scala-SDK-3.0.3-2.10-linux.gtk.x86_64.tar.gz work for Eclipse 4.4?
No, the Scala IDE 3.x timeline doesn't support Luna.
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.

hol...@informatik.htw-dresden.de

unread,
Aug 20, 2014, 1:30:18 PM8/20/14
to scala-i...@googlegroups.com
I've added

scalaVersion := "2.11.2"
libraryDependencies += "org.scala-lang" %% "scala-swing" % "2.11.2"

and I get

[error] (*:update) sbt.ResolveException: unresolved dependency: org.scala-lang#scala-swing_2.11;2.11.2: not found

There's no release version for 2.11 on http://search.maven.org/#search|gav|1|g%3A%22org.scala-lang%22%20AND%20a%3A%22scala-swing%22

Simon Schäfer

unread,
Aug 20, 2014, 1:42:48 PM8/20/14
to scala-i...@googlegroups.com
Then use the latest milestone. scala-swing isn't officially supported anymore, if the milestone doesn't work too, then you probably have to live with the Java Swing API.
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.

hol...@informatik.htw-dresden.de

unread,
Aug 20, 2014, 2:23:54 PM8/20/14
to scala-i...@googlegroups.com
I've set Scala to 2.10 instead in the project properties. The code compiles and works, so it saves me a lot of hassle. However, the IDE issues the warning

The version of scala library found in the build path (2.10.4) is different from the one provided by scala IDE (2.11.2.). Make sure you know what you are doing.    Scala        Unknown    Scala Classpath Problem

How do I remove this warning?

iulian dragos

unread,
Aug 21, 2014, 6:50:38 AM8/21/14
to scala-i...@googlegroups.com
On Wed, Aug 20, 2014 at 7:30 PM, <hol...@informatik.htw-dresden.de> wrote:
I've added

scalaVersion := "2.11.2"
libraryDependencies += "org.scala-lang" %% "scala-swing" % "2.11.2"

Wrong version. Since scala-swing is not part of Scala anymore, it has it's own version (current one is 1.0.1). If you follow the Sbt intructions on this page, you should have a copy-paste solution:


cheers,
iulian
 

and I get

[error] (*:update) sbt.ResolveException: unresolved dependency: org.scala-lang#scala-swing_2.11;2.11.2: not found

There's no release version for 2.11 on http://search.maven.org/#search|gav|1|g%3A%22org.scala-lang%22%20AND%20a%3A%22scala-swing%22

--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais
Reply all
Reply to author
Forward
0 new messages