This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 175394

Summary: scala console and scala_home
Product: contrib Reporter: pezzacolori <pezzacolori>
Component: ScalaAssignee: _ dcaoyuan <dcaoyuan>
Status: RESOLVED INVALID    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description pezzacolori 2009-10-25 23:03:44 UTC
when trying the new scala plugin with the NB6.8beta (but also with the nightly builds) I still get the message:
"SCALA_HOME environment variable is not set, or is invalid. Please select a SCALA_HOME first!"  (2 times)
followed by a 
"Can not found ${SCALA_HOME}/bin/scala, the environment variable SCALA_HOME may be invalid. Please set proper SCALA_HOME
first!" 

when trying to open the SCALA console window.   (on the other way I can compile scala projects within Netbeans ...).

The console works with NB6.7.1 and scala 2.7.3 ...

I set the SCALA_HOME in  .bashrc  and opening a terminal and writing >echo $SCALA_HOME return the correct answer (same
for the PATH). Also writing >scala in a terminal starts scala2.8.0
I also set the scala home in the netbeans.conf file.
Comment 1 pezzacolori 2009-11-29 18:18:11 UTC
I could figure out that the problem is probably a general problem of Netbeans on ubuntu or linux platforms:
Netbeans is not always PATH-aware, depending on how this environment variables are set.
Setting them in 
~/.bhsrc
makes them available to Netbeans only if :
-1 the bash terminal is started
-2 Netbeans is started from that console

Using the menu shortcut doesn't allow Netbeans to read the environment variables set in ~/.bshrc, not even if the shortcut is set as "Application in terminal" (which actually starts up a terminal)!

I could solve it setting the environment variables in 
~/.profile
instead of  ~/.bshrc, which should set the login console.

A small note on this in the wiki could be helpful for the linux newbies like me ...

Cheers,
Boris
Comment 2 reinouts 2012-04-24 13:59:45 UTC
Adding -J-Dscala.home=<yourscaladir> to the netbeans_default_options in netbeans-7.1.1/etc/netbeans.conf should do the trick as well.