Join Patrick Royal for an in-depth discussion in this video Setting up a Cloud account: Windows, part of Using Java to Program Google App Engine.
- View Offline
- In this video, we're going to setup a cloud account on a Windows PC. You can start by navigating to the url shown or simply go to the Google App Engine homepage and choose, "Sign up for cloud account." You will need to login with your Google account or create one if you don't already have an account. This will take you to the Developers Console where you can get all the tools you need for your first project. There are six steps that you need to complete to get your first project setup. First, you need the name of your project. I'll call mine example.
You also need to select the language which is Java. Google App Engine also provides some starter code to help you understand the formatting and see what your code will look like when it runs. By default, the code is a simple Hello World program. The files that are listed in this code are files that you will need for any app so we'll refer back to this framework in the future. Next, we need to install the software development kit. Choose the correct version for your operating system and then click to download and launch. When it finishes downloading, run the exg file to open up the Google Cloud SDK setup wizard.
You don't need to change any settings here. Just click next until you can choose to install it. If you don't already have the latest version of Python installed, then you'll be asked to install it as part of the setup. When you choose to install it, it should install automatically. Since we're just looking at the setup right now, we don't need to start anything up when the installation completes. However, we should try logging in to make sure that Google Cloud is working. Open up a command line and type in gcloud auth login.
This should open up a standard Google login page in your browser. Once you login, you'll be asked to authorize the data access needed by the Google Cloud SDK. Clicking accept will authorize your app. Next, it's useful to have software that will allow you to run and test your app locally rather than having to upload it to the Cloud every time. If you don't already have the latest version of Java installed, you can install it here. Then, you can download the sample program called appengine-try-java.zip and install the latest version of Apache Maven.
Apache Maven has compatible versions for both Windows and Mac. Make sure you get the correct and most up-to-date version installed. Make a note of where you extract each of these files because we now need to reference them via the command line. When you go to where these files are downloaded, go ahead and extract them both. Once they're extracted, we're going to go into the Apache Maven bin folder. Take the folder inside here and then copy it.
Then go to C slash program files and paste it. Now open up a command line and use cd to change your active directory to app engine dash try dash Java. You'll do cd Downloads, cd appengine-try-java and depending on how you extracted this you may need to do cd appengine-try-java again.
Now we're going to add the Maven package into our command line so that we can run Maven commands. So run the command set PATH="c:\program files\apache-maven3. and then the version number which in this case is 2.2 and \bin" in the quotation marks, semi-colon and then %PATH%. This complicated command will add Maven to your command line path, which allows you to directly reference its functions from within the command line.
Once all of this is done, you can finally build the app with the syntax mvn package. Depending on your version of Windows, you may get this error here. If you get this error, you can easily solve it by running another command that sets your Java dot home class. Do set JAVA_HOME=c:\programfiles\java and then \jdk with your jdk version number.
In my case, my version number is 1.8.0_11. Now run the command again and this time it should correctly build your project. If you get a screen telling you that the build was successful, then you've done everything correctly. Now, you can go back to the Google Developers Console agree to the terms and conditions and click, "Create your project." Once that is finished, you have everything you need setup to start developing and deploying projects in the Google App Engine.
In the next video, we're going to talk about how you can efficiently create the actual source code for your project.
- Setting up Google App Engine accounts on Windows and Mac
- Creating a Google App Engine project
- Building the back-end code
- Creating the user interface
- Storing data
- Creating modules
- Testing and debugging
- Enabling security and encryption
- Working with extensions