Note: The second part of this tutorial has been posted here. If you’ve already completed part 1 and are ready to move on, check out part 2 now.
Getting started with Google App Engine development is easy and free. For the purposes of this tutorial, I tend to focus on developing GAE apps from within the Linux platform. However, since both Netbeans and the Google App Engine SDK are multiplatform, these instructions will be pretty much the same on any of the major operating systems (Linux, Mac, or Windows).
Let’s get started.
Sign up for Google App Engine
First things first. Navigate to http://appengine.google.com and sign up to enable your Google Account for use with Google App Engine. In order to activate your account, you will need a phone that supports SMS or text messaging. Thankfully this is not hard to find these days as every major phone for the last bajillion years has this feature.
Create Your App
After activating your account, create your application. Once you’ve got your application name and URL solved, write them down or store the information in a text file. It’s amazing how many times I had to look up what domain Google uses for their cloud apps before they’re live. I’ve been working with Windows Azure and their appname.cloudapp.net setup for so long that I always want to type that instead. Google App Engine apps are located at appname.appspot.com.
Download the Google App Engine SDK
Download and unzip the Google App Engine SDK to a folder on your hard drive. For my projects I use the Java SDK but feel free to download the Python version if that’s your thing.
Install the NetBeans Integrated Development Environment
If you haven’t already, install the NetBeans IDE. This is the program you’ll use to manage your GAE application projects and write source code. Consequently, you are also able to publish GAE apps from within the IDE.
To install NetBeans on Mandriva Linux, type urpmi netbeans in the command-line as the root user. For Debian-based Linux such as Ubuntu, try sudo apt-get netbeans. For other operating systems, try downloading NetBeans manually from the NetBeans homepage.
If you’ve never used NetBeans before, prepare to be blown away. I love this IDE. It runs on all major platforms and has tons of plugins to help brighten your day. In fact, plugins are what we’ll be installing next.
Install the Google App Engine NetBeans Plugin
To install the Google App Engine NetBeans Plugin, follow these instructions:
- Start NetBeans
- Make note of NetBeans version number
- Click Tools -> Plugins
- Select the Settings tab
- Click the Add button
- Type “App Engine” (without the quotes) into the Name field
- If using NetBeans 6.7 paste http://kenai.com/projects/nbappengine/downloads/download/1.0_NetBeans671/updates.xml into the URL field
- If using NetBeans 6.8 paste http://kenai.com/projects/nbappengine/downloads/download/Latest_NetBeans68/updates.xml into the URL field
- If using NetBeans 6.9 paste
http://kenai.com/downloads/nbappengine/NetBeans69/updates.xml into the URL field - Click the OK button
- Click on Available Plugins
- Select all Google App Engine plugins
- If you’re using NetBeans 6.9 you must also install the Java Web Applications plugin for NetBeans. Not sure why, but it will not work without it installed (thanks to the user comments below for this one!)
- Click the Install button
Installing the Google App Engine Service in NetBeans
To install the Google App Engine service in NetBeans, follow these instructions:
- Start NetBeans
- Click on the Services tab next to Projects and Files
- Right-click on Servers and click Add
- Select Google App Engine and Click Next
- Select the location you unzipped the Google App Engine SDK
- Click Next
- Unless you have another service running on port 8080 and port 8765 leave the default port values
- Click Finish
Run the Guestbook Sample App
We are almost done! To test the install and ensure everything runs properly, let’s try running the included Guestbook sample app.
- Start NetBeans
- Click File -> New Project
- Under Samples, select Google App Engine -> Guestbook
- Click Next
- Enter the location in which you’d like to store this project
- Click Finish
- Click the Run button (looks like a green Play button in the toolbar)
At this point you should have a fully-functioning app loaded in your default browser, showing you a guestbook. Congratulations! If you’ve run into any errors along the way and cannot solve them on your own, please leave a comment below.
The next article in this series will focus on deploying your shiny new app to the Google App Engine service.