Scala plugin for netbeans - scala

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.

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.

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.

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

Related

There is an error when I add ruby SDK for my project in rubymine

At the beginning, I opened my project by rubymine. it remind me No ruby interpreter configured for the project. the following error emits when I add the SDK for the project following the wizard.
12:55:57 PM Unknown Module Type
Cannot determine module type ("JAVA_MODULE") for the following module:"p4ep"
The module will be treated as a Unknown module.
Anyone knows that's why?
The error may occur as a result of opening the project in different IDEs.
To fix it you need to replace "JAVA_MODULE" in iml config file .idea/project_name.iml to "RUBY_MODULE"
You can delete the path .idea and restart ruby project. It works for me

Scala Netbeans 8.1 installation configuration

I was able to make some progress in getting Scala running on the Netbeans IDE. I am stuck with what looks like an error finding file sh.exe. I have found this file in my git directory but I have no idea where it should be in a Scala configuration. Here is the beginning of the error message, is this familiar to someone?
SBT -Completion: -Exit: exit -Help: help.
sbt-launch=C:\Users\William\AppData\Roaming\NetBeans\8.0\modules\ext\org.netbeans.libs.sbt\1\org-scala-sbt\sbt-launch.jar
[ERROR] Failed to construct terminal; falling back to unsupported
java.io.IOException: Cannot run program "sh": CreateProcess error=2,
The system cannot find the file specified at
java.lang.ProcessBuilder.start(ProcessBuilder.java:1042)
I had this problem with the newest version of NetBeans Plugin for Scala within Windows OS during use of the Scala SBT plugin. Cygwin should solve the problem (after instalation don't forget to set the path/to/cygwin/bin in the Windows path variable).
When I down load the small installation program and start the install I am presented with a large category of files without one being Scala. Do you know which packages need to be installed or a link to a document?
By continuing the install without adding any additional package and then adding the path as was suggested I was able to compile a scala project in the Netbeans 8.0.2 IDE.

How to add Scala Platform to nebeans 8

I'm trying to use NetBeans 8.01 with Scala, and it can't find the "Scala Platform".
I'm using Windows8.1 x64. I follow this tutorial and also I have read this question but doesn't work.
I follow path tools-->Scala Platform and I have error: The specified folder not contain a Scala platform.
I try to add a new Platform but netbeans not find Scala platform.
Finally I try IntelliJ IDEA with scala and it's work.
So wonder if exist bug in netbeans or I must do something else? Can someone straighten me out?
Thank you
I found solution.
I add "-J-Dscala.home=C:\Program Files (x86)\scala" to the NetBeans/etc/netbeans.conf.
Now I can run an scala program.
However if you want to call scala program from java code in netbeans there are two ways
you must create maven project
package scala code to a jar and add this jar to Java project
Open the netbeans.conf file found in Netbeans/etc/
Find the section netbeans_default_options.
Add
-J-Dscala.home="C:\Program Files (x86)\scala"
in this section. Do not forget the " " around the path as spaces cannot be read.

Getting scala program to run in eclipse

I have the following code in a file in eclipse Philsophers.scala in an eclipse project.
http://www.jakubkorab.net/wp-content/uploads/2011/01/Philosophers.scala
When I right click to run, eclipse does not recognize the runner in this class. Any ideas?
Assuming that it's currently in the default package: it will run once you put it in a correct package, because the file itself specifies a package. The easiest thing is to remove:
package net.jakubkorab.philosophers

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.
I've added a new environment variable $SCALA_HOME that points to D:\Tools\scala-2.8.0.final
I've added $SCALA_HOME\bin to my path variable
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:
Code Completion doesn't work
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:
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/