de.velopmind | The Det about Programming

February 5, 2010

How to setup Netbeans for Google App Engine with Scala

Filed under: GoogleAppEngine, Netbeans, Scala — de.velopmind @ 10:29 pm

This little tutorial describes an easy way to combine in Netbeans 6.8 Google App Engine development with the Scala programming language.

When I started trying to write a first App Engine application with Netbeans and with Scala, I detected that in Netbeans you can’t simply “Add Scala Nature” and have a project that is able to compile Scala sources. So I was under the impression that I had to figure out what the special configurations in the Scala project’s build files are and to mingle them by hand into Web Application build files to get a combined project in the end.

But, as I found out, it is much easier to think of the “application” as a project group and to keep the Web Application project separate from the Scala project and let Netbeans pull everything together.

So in the next steps you will see what I eventually did to set up a Google App Engine application with Scala in Netbeans.

Preconditions

So, well, what you need to write Scala code in Netbeans for Google App Engine is:

Install the plugins

I do not want to repeat here the work which others have done already fairly well. So for installation and setup of the Google App Engine Plugin and the Scala plugin simply follow the instructions to be found under the following links:

Google App Engine:

Scala:

Be aware that the Scala plugin is based on the Scala version 2.8 which is still under development, as well as the plugin itsself is. Scala has to be installed separately.

On my computer (and therefore in this example) it is installed in

C:\Programme\Scala\scala-2.8 .

For the Google App Engine Plugin you must install the App Engine SDK separately. I did that in C:\appengine-java-sdk-1.3.0 .

So after following these instructions you should see something like the following two pictures in your Installed Plugins View

Installed Google App Engine Plugin

Installed Scala Plugin

Configure the libraries

In this step we will configure some library entries which will later be used to setup the projects’ compile time and runtime dependencies. We start with an entry for the Scala runtime library.

In menu Tools select the item Libraries to open the configuration dialog.

Now press New Library and create a new entry named “Scala28” of type “Class Libraries”.

Then select the jar file scala-library.jar in the /lib folder of your Scala installation directory.

You have a new entry for Scala now. This can later be used to define runtime dependencies in non-Scala projects.

Do the same for the Google App Engine jars. I named the entry “AppEngineLibs” here. You have to add the two appengine-api-*.jar files which you find under the /lib/user path in your App Engine SDK installation directory. This entry will later be used to define compile time dependencies in a non-GAE project, for example our Scala project.

So far it was merely a basic netbeans setup procedure which has to be done once.

In the next installment I will show how to setup the combination of projects for each application:   Follow me …

3 Comments »

  1. really intersting!!!

    Comment by Saqlain Raza — February 7, 2010 @ 4:18 pm

  2. Thank you for putting this online!🙂

    Comment by evolvingtrends — April 14, 2010 @ 10:21 pm

  3. good post

    Comment by 2carz — August 7, 2010 @ 11:42 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: