tags:

views:

309

answers:

4

I'm trying to use NetBeans 6.8 with Scala, and it can't find the "Scala Platform" (whatever that is supposed to be). I'm using Ubuntu Lucid Lynx (fully updated).

The libraries are in /usr/share/java, the binaries in /usr/bin, the docs in /usr/share/doc/scala-doc/, and the sources are uninstalled. I think that NetBeans is looking for Scala to be in one single directory (with bin, lib, etc.). I created /usr/share/scala and placed links to the other directories, but it still didn't quite make it.

Can someone straighten me out? (And why is it a "platform"? More needless jargon...)

+1  A: 

If you haven't tried downloading the full Scala package from scala-lang.org, you should do so and then point Tools > Scala Platform > Platform Folder at that directory. I am not sure what Ubuntu does to the normal Scala distribution, but it hasn't kept up very well with maintenance releases and it certainly hasn't kept up with new releases (2.8.0.RCx, for example), so I've been downloading Scala myself.

For instance, on my laptop I have /usr/local/lib/scala-2.8 pointing at some place that I've unzipped scala-2.8.0.RC2.zip, and have set the Platform Folder directory to that link (I'm using 2.8 there, obviously).

Rex Kerr
Ubuntu includes the current stable release (2.7.7), not the current release candidate in testing. Ubuntu also placed things in the proper places in the file system.Having said that, I think your suggestion is probably best.
David
Yes, 10.04 does now (though 9.10 did not follow the bugfix releases to 2.7.7). But anyway, since Ubuntu likes to split things up and Netbeans likes the together, I just reinstalled.
Rex Kerr
A: 

Have you followed the install instructions at: http://wiki.netbeans.org/Scala68v1#Install_with_NetBeans_6.8

I think the NetBeans 6.8 plugin needs a 2.8.x version of Scala to work properly.

Emil H
+1  A: 

The point is that if you installed Scala via apt-get / Synaptic, you don't have Scala 2.8 but 2.7.X, and the NetBeans plugin is made only for 2.8. You can check which version of Scala you are running with the command:

scala -version

While Scala 2.8 isn't available in the Ubuntu repository, you can work with the Scala IDE plugin for Eclipse, which works with 2.7.X or if you prefer IntelliJ IDEA instead of Eclipse, they also have a good plugin for Scala.

By Scala Platform it meant the installment of Scala in your Ubuntu.

moondowner
+3  A: 

As the installation instructions for the plugin explain, you must set the SCALA_HOME environment variable to the directory where you have Scala installed.

So, first download and install the latest release candidate of Scala 2.8.0 somewhere on your system (I like to put it in /usr/local/scala myself). A good place to put the environment variable is in /etc/environment. Add a line like this to that file:

SCALA_HOME=/usr/local/scala

You need to log out and back in to let this take effect.

(Note: Scala 2.8 final is most likely to be released soon, and it contains a lot of new features and changes since 2.7. In my opinion it's best to use the 2.8 release candidates, don't bother too much with the soon to be obsolete version 2.7).

Jesper
I looked at the directions previously. They don't state that the plugin doesn't work with the current stable release of Scala, and they don't state that you will wipe out all of your currently loaded plugins by following them. The directions also dont state where to change netbeans.conf (default options) and dont mention adding -J-Dscala.home=/usr/local/scala to default options.... *Anyway* I followed the directions more closely this time...
David
When I tried it, the system said that the antlib file could not be found. The problem was, I unpacked the Scala 2.8 RC3 into /usr/local/scala - resulting in /usr/local/scala/scala-2.8-RC3/ . Need better directions..
David
@David then you set `SCALA_HOME` to `/usr/local/scala/scala-2.8-RC3`.
Jesper