Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set up Scala for NetBeans - Error

I'm interested in the language Scala and would like to test it with NetBeans Can 6.8. I've downloaded Scala 2.8.0 final und unzipped it to my hard drive. Then I installed the Scala plugin for NetBeans and created a first project. Naturally compilation failed with this message:

You must set SCALA_HOME or environment property and append "-J-Dscala.home=scalahomepath" property to the end of "netbeans_default_options" in NetBeansInstallationPath/etc/netbeans.conf to point to Scala installation directory.

I read what the NetBeans Wiki and the Scala website say to the plugin.

  1. I've added a new environment variable $SCALA_HOME that points to D:\Tools\scala-2.8.0.final
  2. I've added $SCALA_HOME\bin to my path variable
  3. I've edited the netbeans.conf file by adding "-J-Dscala.home=D:\Tools\scala-2.8.0.final" to the end of netbeans_default_options

With your great help this error was fixed. However there are two new problems:

  1. Code Completion doesn't work 2.
  2. After creating a Scala Object this

    package scalaapplication1
    
    
    object te {
    
    
    }
    

    is not accepted. NetBeans complains that

    type ScalaObject is not a member of package Scala

like image 512
lhk Avatar asked Nov 04 '10 19:11

lhk


2 Answers

Strange: the Netbeans Wiki on Scala doesn't mention "scala.home", only the environment variable SCALA_HOME.

So does the tutorial on Scala plugin installation:

alt text


After that, you need to make sure Netbeans is launched from a new dos session (one that has registered the new environment variable definition), and is "path-aware" (like this issue 175394, even though it only concerns Unix platform).


DarrenWang mentions in his article the NBModules plugins to more easily manage those options like "-J-Dscala.home = scalahomepath" in the netbeans.conf file.
But it experienced some crashed with the Scala plugin and the latest Netbeans.

like image 137
VonC Avatar answered Sep 21 '22 08:09

VonC


Can you read Chinese? hehe, I wrote down something here: http://www.zeuux.com/group/scalaba/bbs/content/4240/

like image 44
DarrenWang Avatar answered Sep 21 '22 08:09

DarrenWang