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.
So, well, what you need to write Scala code in Netbeans for Google App Engine is:
- Netbeans (surprise!) – This script was developped on Version 6.8
- Appengine SDK for Java –
- Scala 2.8 (look at: http://www.scala-lang.org/ )
- Netbeans Scala Plugin – ( http://wiki.netbeans.org/Scala68v1 )
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:
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
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 …