fred basset
fred basset

Reputation: 10072

scala not running on Centos Linux box

Help. I am starting out learning Scala. My programs run fine on my Windows PC, but anytime I try to run a program on my Linux box (ibmp2), the output is just the hostname printed twice. See example below. What's wrong?

[sean@ibmp2 ~]$ cat hello.scala
val oneTwo = List(1, 2)
val threeFour = List(3, 4)
val oneTwoThreeFour = oneTwo ::: threeFour
println(""+ oneTwo +" and "+ threeFour +" were not mutated.")
println("Thus, "+ oneTwoThreeFour +" is a new list.")
[sean@ibmp2 ~]$ scala hello.scala
ibmp2: ibmp2
[sean@ibmp2 ~]$ which scala
/usr/local/scala-2.8.1.final/bin/scala
[sean@ibmp2 ~]$ scala
Welcome to Scala version 2.8.1.final (Java HotSpot(TM) Client VM, Java 1.6.0_17).
Type in expressions to have them evaluated.
Type :help for more information.

scala> println("hello")
hello

scala>

Upvotes: 0

Views: 781

Answers (2)

David Winslow
David Winslow

Reputation: 8590

While I haven't run into it with Scala specifically, I have encountered issues with running networking-related Java programs on CentOS/Fedora where the root cause turned out to be that localhost was not resolved in a reverse lookup query somewhere in INetAddress.java (or something, it's been a while since I looked into it.) So, two suggestions:

1) Ensure that Scala is not trying to fire up fsc in the background and connect to it by using scala -nocompdaemon instead of just scala

2) Edit your hosts file (sudoedit /etc/hosts) and make sure localhost and your machine's custom name are both specified therein.

I'm just guessing, but these might resolve the issue.

Upvotes: 5

Jens Schauder
Jens Schauder

Reputation: 81862

To me this looks like you are not executing, what you think you are.

Try using the full path when calling scala.

Upvotes: 0

Related Questions