简体   繁体   English

为NetBeans设置Scala - 错误

[英]Set up Scala for NetBeans - Error

I'm interested in the language Scala and would like to test it with NetBeans Can 6.8. 我对Scala语言感兴趣,并希望使用NetBeans Can 6.8进行测试。 I've downloaded Scala 2.8.0 final und unzipped it to my hard drive. 我已经下载了Scala 2.8.0 final并将其解压缩到我的硬盘上。 Then I installed the Scala plugin for NetBeans and created a first project. 然后我为NetBeans安装了Scala插件并创建了第一个项目。 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. 您必须设置SCALA_HOME或environment属性,并将“ -J-Dscala.home=scalahomepath ”属性附加到NetBeansInstallationPath/etc/netbeans.conf中“ netbeans_default_options ”的末尾,以指向Scala安装目录。

I read what the NetBeans Wiki and the Scala website say to the plugin. 我阅读了NetBeans Wiki和Scala网站对该插件所说的内容。

  1. I've added a new environment variable $SCALA_HOME that points to D:\\Tools\\scala-2.8.0.final 我添加了一个新的环境变量$SCALA_HOME ,指向D:\\Tools\\scala-2.8.0.final
  2. I've added $SCALA_HOME\\bin to my path variable 我已将$SCALA_HOME\\bin添加到我的路径变量中
  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 我通过在netbeans.conf末尾添加“ -J-Dscala.home=D:\\Tools\\scala-2.8.0.final ”来编辑netbeans.conf文件

With your great help this error was fixed. 在你的帮助下,这个错误得到了解决。 However there are two new problems: 但是有两个新问题:

  1. Code Completion doesn't work 2. 代码完成不起作用2。
  2. After creating a Scala Object this 在创建Scala对象之后

     package scalaapplication1 object te { } 

    is not accepted. 不被接受。 NetBeans complains that NetBeans抱怨说

    type ScalaObject is not a member of package Scala 类型ScalaObject不是包Scala的成员

Strange: the Netbeans Wiki on Scala doesn't mention " scala.home ", only the environment variable SCALA_HOME . 奇怪: Scala上的Netbeans Wiki没有提到“ scala.home ”,只提到环境变量SCALA_HOME

So does the tutorial on Scala plugin installation : 关于Scala插件安装的教程也是如此:

替代文字


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). 之后,您需要确保从新的dos会话(已注册新环境变量定义的会话启动 Netbeans,并且是“路径感知”(如此问题175394 ,即使它只涉及Unix平台)。


DarrenWang mentions in his article the NBModules plugins to more easily manage those options like " -J-Dscala.home = scalahomepath " in the netbeans.conf file. DarrenWang他的文章中 提到NBModules插件,可以更轻松地管理netbeans.conf文件中的“ -J-Dscala.home = scalahomepath ”等选项。
But it experienced some crashed with the Scala plugin and the latest Netbeans. 但是它经历了一些与Scala插件和最新Netbeans的崩溃。

Can you read Chinese? 你能读中文吗? hehe, I wrote down something here: http://www.zeuux.com/group/scalaba/bbs/content/4240/ 呵呵,我在这里写下了一些东西: http//www.zeuux.com/group/scalaba/bbs/content/4240/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM