• Menu
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

JavaBeat

Java Tutorial Blog

  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)
  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)

HelloWorld with Netbeans 7.2 beta and Scala 2.9

June 5, 2012 //  by Smita//  Leave a Comment

Here is the step by step procedure to set up the scala(2.9) environment with Netbeans(7.2) on a Windows Vista system

1. Install Netbeans 7.2 Beta if not already installed from here.

2. Download the Scala installable from here. Install Scala on your system.

3. Set the environment variable SCALA_HOME pointing it to the Scala installation directory. (On Windows Vista, Go to Start Menu ->Right click on Computer -> Select Properties -> From the left menu, Click on Advanced system Settings -> Click on the Environment variables button on the bottom right corner -> Create new System variable named SCALA_HOME pointing to the Scala installation directory).

4. Now we need to install Scala plugin for Netbeans. Download the plugin here and extract the content into an appropriate folder.

5. Open Netbeans IDE.

6. On the Menu Bar, choose Tools -> Plugin

7. Choose Downloaded tab. Click on Add Plugins button. Browse to the folder containing scala plugins. Choose all the *.nbm files and hit the Install button on the bottom left corner.

Add plugin and select all nbm files

5. You need to hit the Next / Continue button and accept the agreements on all the windows that pop up after that.

Install_SelectedPlugins

Plugin auto installs everything.

6. Create New Project. You should now be able to see a new category named Scala. Choose Scala Application. Choose your project name / location and click on Finish. An object named Main which prints out “Hello World” gets created by default. You can run this file as is by hitting Shift+F6 just to check if the environment is correctly set. HelloWorld should get printed as output.

Writing a first Scala program on Netbeans 7.2 seemed a breeze. No headache of conf file changes. But Netbeans 7.2 does seem a lot lot slower than its earlier version 7.0(I have not tried 7.1). Probably because it still is a Beta version.

Following are some gotchas if you are trying to get Scala to work on Netbeans 7.0 or an earlier version of Scala-

1. After installing the plugin, you should be able to create a new Scala project. In case you are not, check if any of the scala plugins are not activated. Select them and activate them.

2. Error message – Could not load definitions from resource scala/tools/ant/antlib.xml. It could not be found.

Solution – Check if Scala has been correctly installed. Append “-J-Dscala.home=scalahomepath” property to the end of “netbeans_default_options” in NetBeansInstallationPath/etc/netbeans.conf where scalahomepath is the actual path to the Scala installation directory.

Please do let me know how your Scala environment setup with Netbeans went. I will be happy to respond to your questions if any. Please feel free to add your comments below.

Adios until the next post !

Category: NetBeansTag: NetBeans, netbeans 7.2, scala, scala 2.9

About Smita

Previous Post: « Using Morphia- Java library for MongoDB
Next Post: Developing Groovy based web application and deploying to Google App Engine »

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow Us

  • Facebook
  • Pinterest

FEATURED TUTORIALS

New Features in Spring Boot 1.4

Difference Between @RequestParam and @PathVariable in Spring MVC

What is new in Java 6.0 Collections API?

The Java 6.0 Compiler API

Introductiion to Jakarta Struts

What’s new in Struts 2.0? – Struts 2.0 Framework

JavaBeat

Copyright © by JavaBeat · All rights reserved
Privacy Policy | Contact