top of page
BlogPageTop

Hello World Program Example in Scala with Eclipse IDE

In this Apache Spark Scala tutorial, you will learn how to create,

  • "Hello World" Scala application with Eclipse Scala IDE.

  • Scala application, project, package, objects, run configuration, and debug the application.

The motive is to get you guys familiar with Scala IDE.


I assume that you have already installed Eclipse Scala IDE, if not please refer to my previous post for installation (Windows | Mac users). Next, open Eclipse Scala IDE.


Scala Hello World Example

1. Create a new Scala project "hellooWorld"

  • Go to File → New → Project and enter hellooWorld in the project name field and click finish.





2. Create a new Scala Package "hellooWorld"

  • Right-click on the hellooWorld project in the Package Explorer panel → NewPackage and enter the name hellooWorld and finish.




3. Create a Scala object "hello":

  • Expand the hellooWorld project tree and right-click on the hellooWorld package → NewScala Object → enter hello in the Object name field and press finish.




4. Write the program to print the Hello World message.

package hellooWorld 
object hello {
  def main (args: Array[String]) {
    println("Hello World")
  }
}


5. Create a Run configuration for the Scala application:

  • Right-click on hello.scala in package explorer → Run AsScala Application. Select the first matching item, the HellooWorld class, and click OK.


  • You can also define the configuration manually and run it. Just mention the project and class name.



  • That's it. You can see the output Hello World in the output console.


That's all guys! If you face any problem while running the program please mention it in the comments section below. Thank you.



Navigation menu

​1. Apache Spark and Scala Installation

2. Getting Familiar with Scala IDE

3. Spark data structure basics

4. Spark Shell

5. Reading data files in Spark

6. Writing data files in Spark

7. Spark streaming


Comments


Want to share your thoughts about this blog?

Disclaimer: Please note that the information provided on this website is for general informational purposes only and should not be taken as legal advice. Dataneb is a platform for individuals to share their personal experiences with visa and immigration processes, and their views and opinions may not necessarily reflect those of the website owners or administrators. 

 

While we strive to keep the information up-to-date and accurate, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability, or availability with respect to the website or the information, products, services, or related graphics contained on the website for any purpose. Any reliance you place on such information is therefore strictly at your own risk. 

 

We strongly advise that you consult with a qualified immigration attorney or official government agencies for any specific questions or concerns related to your individual situation. We are not responsible for any losses, damages, or legal disputes arising from the use of information provided on this website. 

 

By using this website, you acknowledge and agree to the above disclaimer and Google's Terms of Use and Privacy Policy.

bottom of page