The Artima Developer Community
Sponsored Link

Programming in Scala Forum
import scala.swing._ not working

3 replies on 1 page. Most recent reply: Feb 10, 2013 8:56 AM by Yu Shen

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Jim Otto

Posts: 4
Nickname: jimotto
Registered: Dec, 2012

import scala.swing._ not working Posted: Dec 19, 2012 2:53 AM
Reply to this message Reply
Advertisement
And so Chapter 34 of Programming in Scala, Second Edition, is not working for me. I'm currently using
Debian package scala-2.9.2.deb (md5) 21.0 MB
from
http://www.scala-lang.org/downloads
which yields

Welcome to Scala version 2.9.2 (OpenJDK 64-Bit Server VM, Java 1.7.0_09).
Type in expressions to have them evaluated.
Type :help for more information.

scala> import scala.swing._
<console>:7: error: object swing is not a member of package scala
import scala.swing._
^

scala>

So sbaz went away with 2.9.1 and is yet to be replaced? Is sbt somehow an alternative?


Jim Otto

Posts: 4
Nickname: jimotto
Registered: Dec, 2012

Re: import scala.swing._ not working Posted: Dec 25, 2012 12:24 AM
Reply to this message Reply
OK. I finally started going through the sbt tutorial including at

http://www.scala-sbt.org/release/docs/Getting-Started/Basic-Def.html

With a build.sbt file consisting of the 1 line

libraryDependencies += "org.scala-lang" % "scala-swing" % "2.9.2"

(from a Mark Lister Coursera Scala course discussion) I FINALLY got Programming in Scala, 2nd Ed, p 762, to work!

Jim Otto

Posts: 4
Nickname: jimotto
Registered: Dec, 2012

Re: import scala.swing._ not working Posted: Dec 25, 2012 1:32 AM
Reply to this message Reply
Contents for the sbt tutorial:

http://www.scala-sbt.org/release/docs/index.html

Yu Shen

Posts: 2
Nickname: 85161
Registered: Dec, 2012

Re: import scala.swing._ not working Posted: Feb 10, 2013 8:56 AM
Reply to this message Reply
For Scala 2.10, the compatible version of Scala swing is 2.10.0. Use 2.9.0, 2.9.1, 2.9.2 would crash, with the following error:
java.lang.ClassNotFoundException: scala.collection.GenTraversableLike$class

I wish to learn how to figure the following:
1. How to figure out the compatible version of Scala swing
2. How to tell my current library's version.

Thanks,

Yu

Flat View: This topic has 3 replies on 1 page
Topic: Good practice of layout design with Scala Swing Previous Topic   Next Topic Topic: www.scala-lang.org uses an invalid security certificate


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us