开发者

Set up Scala for NetBeans - Error

开发者 https://www.devze.com 2023-01-23 19:19 出处:网络
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 NetBea

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


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:

Set up Scala for NetBeans - Error


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消