Trouble loading project into IDEA

933 views
Skip to first unread message

Luigi

unread,
Aug 6, 2011, 12:31:00 AM8/6/11
to scala-labs
I'd like to have a go at these labs, but am finding it tough to get
going! I've never used SBT or Maven before, and I imagine there are
many other beginners who won't have either.

I'm looking at your getting started guide at http://scala-labs.github.com/getting-started.html.
I have installed SBT and Maven... what do I do now? Sorry for being
clueless, but I have no idea.

I've also tried opening the project in IDEA 10.5 but it doesn't load:
I get an error message saying "Cannot convert project: .... Scala-labs
\labs\.idea\modules.xml (The system cannot find the file specified)"

Thanks for any more specific advice.

Arjan Blokzijl

unread,
Aug 6, 2011, 1:41:27 AM8/6/11
to scala...@googlegroups.com
The instructions are slightly outdated, it seems: the maven part should still work, but the build has been ported to the latest sbt version (0.10). Setup instructions for that can be found here https://github.com/harrah/xsbt/wiki/Setup
Personally I would suggest to use sbt and ditch maven. There is a plugin for sbt that will generate the idea module files for you, setup instructions for this are here: https://github.com/mpeltonen/sbt-idea
After setting this up, just go to the 'labs' folder of the project, launch sbt, and after that generate the idea module files using the plugin with the 'gen-idea' command, and test can be run using the 'test' command, as shown below.

You might see a number of warnings about it not being able to find certain dependencies when running gen-idea, but just ignore those. After executing this, all required files are there and you can open the project in idea.Idea also has an sbt plugin, so you can run the tests within intellij using the sbt console.

Arjan


arjan@ulysses:~/dev/scala/scala-labs/labs$ sbt10 
Getting org.scala-tools.sbt sbt_2.8.1 0.10.1 ...
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
36 artifacts copied, 0 already retrieved (6414kB/364ms)
[info] Set current project to default-6a8392 (in build file:/home/arjan/.sbt/plugins/)
[info] Updating {file:/home/arjan/.sbt/plugins/}default-6a8392...
[info] Done updating.
[info] Set current project to default-d5230b (in build file:/home/arjan/dev/scala/scala-labs/labs/)
> gen-idea
[info] Trying to create an Idea module default-d5230b
[info] Updating {file:/home/arjan/dev/scala/scala-labs/labs/}default-d5230b...
...... lots of stuff...
[info] 
[info] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
[info] Created /home/arjan/dev/scala/scala-labs/labs/.idea_modules/project.iml

> test
[info] Compiling 35 Scala sources and 1 Java source to /home/arjan/dev/scala/scala-labs/labs/target/scala-2.9.0.final/classes...
[info] 'compiler-interface' not yet compiled for Scala 2.9.0.final. Compiling...
[info]   Compilation completed in 43.343 s
[info] Compiling 19 Scala sources to /home/arjan/dev/scala/scala-labs/labs/target/scala-2.9.0.final/test-classes...
[error] Could not run test org.scalalabs.intermediate.lab03.ThirdExerciseTest: org.scalatest.junit.JUnitTestFailedError: TODO: uncomment and fix
[info] BasicPatternMatchingExerciseTest:
[info] - matchLanguageOnStrings *** FAILED ***
[info]   java.lang.ExceptionInInitializerError:
[info]   at org.scalalabs.basic.lab03.BasicPatternMatchingExerciseTest.matchLanguageOnStrings(BasicPatternMatchingExerciseTest.scala:14)

Luigi

unread,
Aug 7, 2011, 2:17:36 AM8/7/11
to scala-labs
Thanks Arjan.

I added the two lines suggested in the Installation section on the
page https://github.com/mpeltonen/sbt-idea, into the labs/build.sbt
file, but when I run gen-idea I get:

> gen-idea
[error] Not a valid command: gen-idea
[error] Not a valid project ID: gen-idea
[error] Not a valid configuration: gen-idea
[error] Not a valid key: gen-idea
[error] gen-idea
[error] ^

Am I supposed to download the files on that page? I have downloaded
them, but I don't know what to do with them, or if SBT is supposed to
download them itself.

Arjan Blokzijl

unread,
Aug 7, 2011, 2:33:09 AM8/7/11
to scala...@googlegroups.com


You have two options: either add the two lines in a plugins in your home directory, in the file ~/.sbt/plugins/build.sbt. If I'm not mistaken, that is also described in the sbt-idea plugin page. This will install the plugin as a global plugin, made available to all your sbt projects. If you want to narrow the scope of the plugin to just the labs project, you should put the lines into the file labs/project/plugins/build.sbt. You can find more information on plugins on the page https://github.com/harrah/xsbt/wiki/Plugins, if needed.

Cheers, Arjan

Luigi

unread,
Aug 7, 2011, 6:11:09 PM8/7/11
to scala-labs
I'm trying to do this on Windows - I don't have a ~/ or a .sbt folder
anywhere I can see, and in the labs/project/ folder there is no
plugins folder or build.sbt file. Isn't "~/" your home directory on
UNIX systems? Where am I supposed to look on Windows? Have I missed
some set-up step that I'm supposed to do? I can't see any such
instructions on the page you link to.

I have tried creating another project using SBT and there is no
plugins folder in that either. Am I supposed to manually create this
folder?



On Aug 7, 7:33 am, Arjan Blokzijl <arjanblokz...@gmail.com> wrote:
> You have two options: either add the two lines in a plugins in your home
> directory, in the file ~/.sbt/plugins/build.sbt. If I'm not mistaken, that
> is also described in the sbt-idea plugin page. This will install the plugin
> as a global plugin, made available to all your sbt projects. If you want to
> narrow the scope of the plugin to just the labs project, you should put the
> lines into the file labs/project/plugins/build.sbt. You can find more
> information on plugins on the pagehttps://github.com/harrah/xsbt/wiki/Plugins, if needed.
>
> Cheers, Arjan
>
> On 7 August 2011 08:17, Luigi <rjones...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Thanks Arjan.
>
> > I added the two lines suggested in the Installation section on the
> > pagehttps://github.com/mpeltonen/sbt-idea, into the labs/build.sbt

Arjan Blokzijl

unread,
Aug 8, 2011, 12:36:34 AM8/8/11
to scala...@googlegroups.com
On 8 August 2011 00:11, Luigi <rjon...@gmail.com> wrote:
I'm trying to do this on Windows - I don't have a ~/ or a .sbt folder
anywhere I can see, and in the labs/project/ folder there is no
plugins folder or build.sbt file.
 
You have to create this yourself.
 
Isn't "~/" your home directory on
UNIX systems? Where am I supposed to look on Windows?
 

 
Have I missed
some set-up step that I'm supposed to do? I can't see any such
instructions on the page you link to.

I have tried creating another project using SBT and there is no
plugins folder in that either. Am I supposed to manually create this
folder?

 
Yes 

Luigi

unread,
Aug 8, 2011, 11:31:28 PM8/8/11
to scala-labs
Thanks, I have it working (I think), finally, 3 days later and after
several hours groping in the dark!

I imagine lesser mortals than myself would have been scared off,
though. I almost gave up myself. If the Scala-labs creators want
people to use it they should definitely spend some time collating some
detailed and up-to-date instructions, because all the peripheral
technologies that maybe you take for granted present a huge barrier. I
spent about an hour downloading and trying to get Maven to work, which
seems to have been a waste of time. A video demo would also be
extremely useful.

Arun Ramakrishnan

unread,
Aug 18, 2011, 7:35:34 PM8/18/11
to scala...@googlegroups.com
This is a community. I don't believe scala-labs is not maintained for profit. As a community member since you have figured out the issues, why don't you commit the necessary changes.

The scala-labs sit has a big bold "fork me on github" and also on how to contribute.

thanks
Arun

Luigi

unread,
Aug 22, 2011, 11:59:31 PM8/22/11
to scala...@googlegroups.com
Hi Arun. I have no interest in promoting Scala Labs to the wider world, although presumably whoever made the effort to set up the website and develop them does, so I made some suggestions, which I hope will be taken in the constructive spirit in which they were offered.

IMO it's crazy to offer a beginners' product which assumes you're already a competent user of GitHub, SBT, and IntelliJ IDEA, can translate instructions from UNIX to Windows, are experienced in test-driven-development, can locate instuctions for everything on 5 different websites, wade through them all to find the useful parts, and fill in all the gaps yourself. From the level of activity here on Google Groups, it appears this "community" is dead, which is a shame, but not altogether surprising since in the absence of clear instructions 99% of people will never get to the stage of using the product.

Jeroen van Erp

unread,
Sep 5, 2011, 4:00:21 AM9/5/11
to scala...@googlegroups.com
just back from my holiday, but let me comment on this.

Scala Labs is meant to teach you Scala not anything else. If you're not proficient in test driven development, go read a book. If you don't know how your IDE works, go read its manual. It's like doing a photography course and you don't even know how your camera works. You cannot possibly ask of the teacher that he knows every bell and whistle of your camera and has documented that. The teacher only has the basics of your camera covered, the rest is up to you!

Regards,
Jeroen

On Tue, Aug 23, 2011 at 5:59 AM, Luigi <rjon...@gmail.com> wrote:
Hi Arun. I have no interest in promoting Scala Labs to the wider world, although presumably whoever made the effort to set up the website and develop them does, so I made some suggestions, which I hope will be taken in the constructive spirit in which they were offered.

IMO it's crazy to offer a beginners' product which assumes you're already a competent user of GitHub, SBT, and IntelliJ IDEA, can translate instructions from UNIX to Windows, are experienced in test-driven-development, can locate instuctions for everything on 5 different websites, wade through them all to find the useful parts, and fill in all the gaps yourself. From the level of activity here on Google Groups, it appears this "community" is dead, which is a shame, but not altogether surprising since in the absence of clear instructions 99% of people will never get to the stage of using the product.



--
-- 
Jeroen van Erp
T: @hierynomus

Reply all
Reply to author
Forward
0 new messages