Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6687439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:17:20+00:00 2026-05-26T05:17:20+00:00

I am learning Scala and I am stuck at hello world script. My hello.scala

  • 0

I am learning Scala and I am stuck at hello world script.

My hello.scala is:

Console.println("Hello World")  

I am running the script like this:

scala hello.scala  

I get a weird exception:

java.net.UnknownHostException: salil: salil: Name or service not known
    at java.net.InetAddress.getLocalHost(InetAddress.java:1438)
    at scala.tools.nsc.io.Socket$.localhost(Socket.scala:38)
    at scala.tools.nsc.CompileSocket.getsock$1(CompileSocket.scala:169)
    at scala.tools.nsc.CompileSocket.getOrCreateSocket(CompileSocket.scala:184)
    at scala.tools.nsc.ScriptRunner.compileWithDaemon(ScriptRunner.scala:80)
    at scala.tools.nsc.ScriptRunner.compile$1(ScriptRunner.scala:123)
    at scala.tools.nsc.ScriptRunner$$anonfun$withCompiledScript$1.apply$mcZ$sp(ScriptRunner.scala:157)
    at scala.tools.nsc.ScriptRunner$$anonfun$withCompiledScript$1.apply(ScriptRunner.scala:131)
    at scala.tools.nsc.ScriptRunner$$anonfun$withCompiledScript$1.apply(ScriptRunner.scala:131)
    at scala.tools.nsc.util.package$.waitingForThreads(package.scala:26)
    at scala.tools.nsc.ScriptRunner.withCompiledScript(ScriptRunner.scala:130)
    at scala.tools.nsc.ScriptRunner.runScript(ScriptRunner.scala:188)
    at scala.tools.nsc.ScriptRunner.runScriptAndCatch(ScriptRunner.scala:201)
    at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala

my SCALA_HOME is /opt/scala-2.9.1.final
and my Path has $SCALA_HOME/bin in it.
My JAVA_HOME is: /usr/java/jdk1.7.0

Is this an issue with my settings or is it due to some issue with Scala libraries and JDK1.7?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:17:21+00:00Added an answer on May 26, 2026 at 5:17 am

    It seems your host name does not resolve to correct IP address, so scala could not connect to the compiler service. Please check your /etc/hosts file, it should have a a record like the following:

    127.0.0.1    salil
    

    After setting your hostname/IP mapping, you could use ping salil command to confirm that you the setting is correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just learning scala, and I wrote the hello,world program like this: object HelloWorld
So I'm learning Scala and came across some examples like this: val doubleEven =
Many of the available resources for learning Scala assume some background in Java. This
first of all, i'm learning scala and new to the java world. I want
I'm learning Scala, so this is probably pretty noob-irific. I want to have a
I'm still at the beginning in learning scala in addition to java and i
Well, I'm learning Scala so this question may be too basic for most people.
I am new to Scala, just started learning, so this is basic beginner question.
I'm learning Scala and lift at the same time and I got stuck on
I'm learning scala and can't find out how to do this: I'm doing a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.