There really isn't that much to get BlazeDS up and running on either of these systems, largely thanks to the ease of use built into Ubuntu. Here are the instructions to get it up and running.
1. Grab the Vancouver build of BlazeDS from here.
2. Unzip it to your desktop. Ubuntu 9.04 makes this simple as all you have to do is double click on the *.zip package, the same as OS X or Windows.
3. Check to see if you have a JDK configured and installed. To do this, grab a terminal and type in "javac" and see what comes back. If you have not installed a JDK before, you will get a message similar to this one:
4. This means you have to use a great feature of Ubuntu. The apt-get command is a powerful command-line tool used to work with Ubuntu's Advanced Packaging Tool (APT) performing such functions as installation of new software packages, upgrade of existing software packages and more. It can even update the O/S. apt-get has numerous advantages over other package management tools available in Ubuntu for server administrators. Some of these advantages include ease of use over simple terminal connections (SSH) and the ability to be used in system administration scripts, which can, in turn, be automated by the cron scheduling utility.
5. Run the command "sudo apt-get install sun-java6-jdk". This will install the Sun Java JDK. I chose this one over the others as I consider it the reference implementation for a JDK. Once you hit enter, you will be asked for your admin password and then the magic begins. I swear this was the easiest Java install I have ever done in my life. Thank you whoever created this tool at Ubuntu!!!
6. At some point during the install, you will be hit with the Sun license agreement. There will be a little (yes)
7. When this completes, you should be able to type "javac" into the command line and see the proper output (basically a prompt asking you for options).
8. Navigate to the folder where you saved the BlazeDS build from step 1. Using the terminal, chmod it to make it executable ( chmod -R 755 BlazeDS/ ). Chmod makes the file persist in a mode of "executable" if given the 755 argument. You may have to change to su to do this. This can be accomplished by typing in "sudo" in front of the command.
administrator@ubuntu-904:~/Desktop$ whereis java
java: /usr/bin/java /usr/share/java /usr/share/man/man1/java.1.gz
12. Navigating to /etc/alternatives/java also revealed that this too was a symbolic link. The real target was /usr/lib/jvm/java-6-sun/jre/bin/java. This means that the real value for $JAVA_HOME will be /usr/lib/jvm/java-6-sun/.
13. To set this, use a line editor of your choice. I am going to use pico as pico is one I am familiar with. To do this, type the following in your terminal:
- "cd ~"
- "pico .bashrc"
14. Pico should bring up a configuration file. If it is not already filled in with lots of values, check the name of the config file and try again. In this file, you can add comments so I usually append my custom entries to the bottom of the file. In this case, at the very bottom, I enter the following lines of code:
# JAVA_HOME added by Duane Nickull
export JAVA_HOME=/usr/lib/jvm/java-6-sun
15. To save your .bashrc profile use "Control X" and answer "Y". Quit the current instance of terminal and open a new one. Test that your JAVA_HOME environmental variable is okay by typing in "echo $JAVA_HOME". You should see output like below:
16. With your terminal, navigate to the BlazeDS root folder, then change directory to the "sampledb" folder. Type in the following: "sh startdb.sh". The sample database should start up.
17. Start another instance of terminal and navigate to the BlazeDS root folder, then navigate to subfolders "tomcat" and "bin". Type in the following: "sh catalina.sh run".
18. Fire up a web browser and navigate to http://localhost:8400 (the default port the BlazeDS will be running on). Voila! You are done.
Coming up next will be some tutorials on Flex and AIR development on Linux if anyone is interested.