- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Absolute beginner question
On FC11, just downloaded & installed scala using yum install scala, got
version 2.7.4.
I've run it interactively and it works fine.
I create a one-line hello world script...
println("Hello, world from a script!")
...and run it...
[lezzgiles@bedroom scala]$ scala hello.scala
bedroom: bedroom
[lezzgiles@bedroom scala]$
Note that "bedroom" is my hostname. I've googled for some kind of answer,
but can't find anything. If I try it with a non-existent file, it does the
sensible thing:
[lezzgiles@bedroom scala]$ scala /no-such-file
no such file: /no-such-file
[lezzgiles@bedroom scala]$
If I try it with a file that doesn't contain valid scala, it also just
prints out the hostname a couple of times:
[lezzgiles@bedroom scala]$ scala ~/.bash_profile
bedroom: bedroom
[lezzgiles@bedroom scala]$
I really want to start playing with this language, but I'm sort-of stuck
here...
Lezz Giles










Re: Absolute beginner question
On Thu, Nov 5, 2009 at 8:04 PM, lezzgiles <lezzgiles [at] gmail [dot] com> wrote:
--
Daniel C. Sobral
Veni, vidi, veterni.
Re: Absolute beginner question
Problem solved - I hadn't set up /etc/hosts with the filename. I've seen
similar problems with redhat-based distros with other tools.
Thanks for the help - I'm looking forward to replacing my Perl/Python/Ruby
expertise with Scala...
Lezz
Daniel Sobral wrote:
>
> Funny you couldn't find anything.
>
> Basically, Scala requirest `hostname` to be reachable on the network. If
> you
> can't ping it, you can't use neither "scala" nor "fsc". You can use
> "scalac"
> to compile, though.
>
> The reason for that is that "fsc" install itself as a daemon, to speed up
> compilation. The "scala" command, used for scripts and REPL, uses "fsc" to
> improve its own performance.
>
> My suggestion, edit /etc/hosts and add your hostname to the line with
> 127.0.0.1.
> On Thu, Nov 5, 2009 at 8:04 PM, lezzgiles wrote:
>
>>
>> On FC11, just downloaded & installed scala using yum install scala, got
>> version 2.7.4.
>>
>> I've run it interactively and it works fine.
>>
>> I create a one-line hello world script...
>>
>> println("Hello, world from a script!")
>>
>> ...and run it...
>>
>> [lezzgiles@bedroom scala]$ scala hello.scala
>> bedroom: bedroom
>> [lezzgiles@bedroom scala]$
>>
>> Note that "bedroom" is my hostname. I've googled for some kind of
>> answer,
>> but can't find anything. If I try it with a non-existent file, it does
>> the
>> sensible thing:
>>
>> [lezzgiles@bedroom scala]$ scala /no-such-file
>> no such file: /no-such-file
>> [lezzgiles@bedroom scala]$
>>
>> If I try it with a file that doesn't contain valid scala, it also just
>> prints out the hostname a couple of times:
>>
>> [lezzgiles@bedroom scala]$ scala ~/.bash_profile
>> bedroom: bedroom
>> [lezzgiles@bedroom scala]$
>>
>> I really want to start playing with this language, but I'm sort-of stuck
>> here...
>>
>> Lezz Giles
>> --
>> View this message in context:
>> http://old.nabble.com/Absolute-beginner-question-tp26222796p26222796.html
>> Sent from the Scala - User mailing list archive at Nabble.com.
>>
>>
>
>
Re: Absolute beginner question
On Fri, Nov 6, 2009 at 1:56 AM, lezzgiles <lezzgiles [at] gmail [dot] com> wrote:
--
Daniel C. Sobral
Veni, vidi, veterni.
Re: Absolute beginner question
We've seen something like this on the lists before.
In that case it was a problem with networking config on the machine
Take a look at this thread:
http://old.nabble.com/println-don't-work-to25194605.html#a25195269
On Thu, Nov 5, 2009 at 10:04 PM, lezzgiles wrote:
>
> On FC11, just downloaded & installed scala using yum install scala, got
> version 2.7.4.
>
> I've run it interactively and it works fine.
>
> I create a one-line hello world script...
>
> println("Hello, world from a script!")
>
> ...and run it...
>
> [lezzgiles@bedroom scala]$ scala hello.scala
> bedroom: bedroom
> [lezzgiles@bedroom scala]$
>
> Note that "bedroom" is my hostname. I've googled for some kind of answer,
> but can't find anything. If I try it with a non-existent file, it does the
> sensible thing:
>
> [lezzgiles@bedroom scala]$ scala /no-such-file
> no such file: /no-such-file
> [lezzgiles@bedroom scala]$
>
> If I try it with a file that doesn't contain valid scala, it also just
> prints out the hostname a couple of times:
>
> [lezzgiles@bedroom scala]$ scala ~/.bash_profile
> bedroom: bedroom
> [lezzgiles@bedroom scala]$
>
> I really want to start playing with this language, but I'm sort-of stuck
> here...
>
> Lezz Giles
> --
> View this message in context: http://old.nabble.com/Absolute-beginner-question-tp26222796p26222796.html
> Sent from the Scala - User mailing list archive at Nabble.com.
>
>
Re: Absolute beginner question
2.7.4 is fairly old, but I just tried that version and it worked fine. Try "set -x" on the command line, then run it. I'm not sure it will tell us anything, but...
dean
On Thu, Nov 5, 2009 at 4:04 PM, lezzgiles <lezzgiles [at] gmail [dot] com> wrote:
--
Dean Wampler
coauthor of "Programming Scala" (O'Reilly)
- http://programmingscala.com
twitter: @deanwampler, @chicagoscala
Chicago-Area Scala Enthusiasts (CASE):
- http://groups.google.com/group/chicagoscala
- http://www.meetup.com/chicagoscala/ (Meetings)
http://www.linkedin.com/in/deanwampler
http://www.polyglotprogramming.com
http://aquarium.rubyforge.org
http://www.contract4j.org