Scala plugin for netbeans

2019-09-06 08:16发布

问题:

I try to run scala plugin under NetBesans 6.9.1. I install scala from arch linux repositories. Then i download netbeans-6.9.1 and scala plugin. Installed plugin. When i create scala application with hello world and try it to build i get error:

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. 

How can i fix it?

I put in my netbeans.conf J-Dscala.home=/usr/bin/scala but it's not helpful. After that i get error: Could not load definitions from resource scala/tools/ant/antlib.xml. It could not be found.

Thank you.

回答1:

I do not have Arch Linux installed, but looking at scala package contents I think the proper value for SCALA_HOME is /usr/share/scala.



回答2:

If you don't want to mess up with the environment variables in linux while setting up scala in netbeans then:

search for "scala-library.jar"

wherever you find it, copy that location and assign "J-Dscala.home" to that

for example

"J-Dscala.home=/home/username/project/.../scala2.8.1"

that's it.

It worked out for me try it in your case.



回答3:

Isn't the error message helpful enough? Did you edit the netbeans.conf file?