Cannot execute hello world script

108 views
Skip to first unread message

David Pérez

unread,
Nov 19, 2012, 5:37:50 AM11/19/12
to scala...@googlegroups.com
Dear Scala gurus,

I have written some scripts in Scala.

But now, I cannot even run a hello world script like this:

#!/bin/sh
    exec scala "$0" "$@"
!#
Console.println("Hello, world!")

under Centos 6.2.

I have installed the official rpm for Scala 2.9.2.

Of course, execute permissions are set.

I'm confused because I can run Scala scripts normally in other CentOS 6.2 computer.

The symptomps are that when running from the console, it freezes for ever.

Any idea please?

David Pérez

unread,
Nov 19, 2012, 6:31:01 AM11/19/12
to scala...@googlegroups.com
More information:

java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.6) (rhel-1.43.1.10.6.el6_2-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

I have saved the hello world script to a file called "hello".

It freezes with:

$ ./hello
$ scala hello

Daniel Sobral

unread,
Nov 19, 2012, 6:56:35 AM11/19/12
to David Pérez, scala-user
There are two things you may want to look at. First, `hostname`  must resolve to your host's IP address -- even if it's 127.0.0.1. Second, there may be an fsc daemon running causing the trouble. Try running fsc -shutdown.
--
Daniel C. Sobral

I travel to the future all the time.

David Pérez

unread,
Nov 19, 2012, 7:24:06 AM11/19/12
to scala-user
Thanks Daniel for your hints,

hostname works ok and no fsc daemon was running.

Any more ideas?
Am I the only one having such a basic problem?

---------------------
Saber es poder
        David



2012/11/19 Daniel Sobral <dcso...@gmail.com>

David Pérez

unread,
Nov 19, 2012, 11:32:44 AM11/19/12
to scala-user
Thanks Paul!!!!
It has solved my problem.
I wonder why I do need this parameter in one equipment and don't in other ones.
I think -nc means no compile daemon.  Does it?
Is this a Scala bug or a misconfiguration?.

---------------------

        David



2012/11/19 Paul Phillips <pa...@improving.org>
-nc

Jason Zaugg

unread,
Nov 19, 2012, 11:36:44 AM11/19/12
to David Pérez, scala-user
On Mon, Nov 19, 2012 at 5:32 PM, David Pérez <san...@gmail.com> wrote:
Thanks Paul!!!!
It has solved my problem.
I wonder why I do need this parameter in one equipment and don't in other ones.
I think -nc means no compile daemon.  Does it?
Is this a Scala bug or a misconfiguration?.

The compile daemon is an optimization to make startup of the script faster. But has some known issues on certain systems related to TCP/IP configuration (here's an in-flight attempt to fix one of them [1])

-jason

David Pérez

unread,
Nov 19, 2012, 11:39:22 AM11/19/12
to scala-user
Found also this problems related to scripts:
http://article.gmane.org/gmane.comp.lang.scala.user/55287

---------------------
Saber es poder
        David



2012/11/19 Jason Zaugg <jza...@gmail.com>
Reply all
Reply to author
Forward
0 new messages