Showing newest 6 of 7 posts from September 2009. Show older posts
Showing newest 6 of 7 posts from September 2009. Show older posts

Thursday, September 10, 2009

Creating a Red5 User Development Environment with Eclipse 3.5

Notes

This article is intended to get you setup with an environment in which you can develop applications - both server and client side - for the Red5 application server. It is NOT meant to set you up to make modifications to the Red5 server code itself, although there are only a few additional steps you need in order to do that.

It is assumed that you will want to write server applications in Java and client applications in Flex using the Flex Builder plugin for Eclipse.. There are other options; you could write server code in a number of scripting languages that run in the JVM, and you could write client applications in Flash using AS2 or AS3 or the open source Flex SDK. These other options are not covered by this guide.

Prerequisites

  1. Java 6
  2. A Mac OS X system if you wish to follow these instructions step-by-step. If you are using another platform, you will have to make your own minor variations here and there.

Installation & Configuration

  1. Install Eclipse 3.5 (Carbon) JEE Edition.
  2. Install the Flex Builder 3.2 plugin. (optional; for building client applications)
  3. Install the Red5 0.9 RC1 server.
  4. Install the Red5 0.2 plug-in
  5. Configure the Red5 plug-in

Configuring the Red5 Plug-in for Eclipse 3.5 with Red5 0.9 RC1

Prerequisites

  1. Eclipse 3.5 (Carbon)
  2. Red5 plugin 0.2 installed
  3. Red5 0.9 RC1 server installed
  4. Java 6. If you are running Mac OS X 10.6 (Snow Leopard), you already have Java 6.

Notes


If you are following the instructions to setup a Red5 User Development Environment, at this point you have the plug-in installed, but you still need to configure it to use your particular Red5 server.

There are also instructions available on the Red5 wiki.

Configuration

  1. Launch Eclipse 3.5.
  2. From the Java EE perspective, choose the Servers view. If you can't find the view, open it with Window -> Show View -> Servers.
  3. Since we haven't added any servers yet, the view is blank.

    Right click on the background of the Server view and choose New -> Server.

  4. In the New Server dialog box that appears, scroll down in the server type list to Infrared5 and expand it by clicking on the triangle to the left of it. Select "Red5 Server Runtime". Then click Next.
  5. On the next panel, we immediately see an error message: "Missing classpath entry /Applications/Red5/red5.jar".
    If you see this, great! It means you're following along with the instructions. What we want to do first is select the correct JRE to run Red5 under. From the JRE pulldown, choose JVM 1.6. [If there is no option for JVM 1.6, one of four things is true: (a) your system is not up to date (this requires OS X 10.5 + updates) (b) your system doesn't support Java 6 (requires a 64bit cpu on Mac OS X), (c) you aren't running Mac OS X and should be using different directions, or (d) you should select the link above the JRE pulldown for "Installed JRE preferences" to create an entry for Java 6. ]
  6. On the same panel we now have to replace the /Applications/Red5 directory with the correct path to the Red5 server folder. Following the guide to Installing Red5 Server, the new value should be /Applications/red5-0.9.RC1. After making the change, click the Next button.

  7. On the next panel we're faced with another error. Luckily the answer is to do the same thing we did in the last step: replace /Applications/Red5 with the location we installed Red5 in. When you're done, click the Finish button.


  8. You should see a shiny new "Red5 Server Runtime at localhost" entry in the Servers view.
  9. Congratulations! You now have the Red5 Plug-in configured and your server should be ready to use.

Testing your installation


You can now start and stop the server from the "Server" view in the Java EE perspective by right clicking on the Red5 Server Runtime and choosing Start (or Debug) and Stop. In the future, once you've configured your applications to run on the server, any changes you make to your server applications should automatically publish to your Red5 installation folder. In most cases the webapp(s) will be reloaded automatically and you can run your client applications to test them.

To start your server, right click on the "Red5 Server Runtime" and choose Start. (If you get an error message that the port is in use, Stop the server, then choose Start again).


You should see some log messages scroll by in the Console view:



Followed by Eclipse returning to the Servers view and showing the server with a status of "Synchronized".



If you made it this far, wonderful! It looks like your server is now running from Eclipse. You're now ready to develop server-side applications in Red5!

Wednesday, September 9, 2009

Installing the Red5Plugin 0.2 in Eclipse 3.5 on Mac OS X

Background

The Red5Plugin is an Eclipse plugin to facilitate developing Red5 applications. Once configured correctly, it enables you to start and stop the server easily and create projects from templates.

These instructions were written with a Mac OS X system in mind. If you are using another platform, you should expect there to be variations in the screenshots and steps necessary to install this component.

Prerequisites

  1. A red5 server installation, version 0.9 (RC1)
  2. An Eclipse 3.5 (Carbon) installation
  3. Java 6. If you are running Mac OS X 10.6 (Snow Leopard), you already have Java 6.

Notes


There are official installation directions available here: http://trac.red5.org/wiki/Red5Plugin
The instructions below are provided in the event you wish an alternate set of instructions.

Installation

  1. Choose Help -> Install New Software
  2. In the "Work with" field, insert "http://trac.red5.org/chrome/site/projects/red5plugin/update_0.2.x/" and click the Add button
  3. In the Add Site dialog that appears, enter "Red5Plugin 0.2.x (Eclipse 3.2+)" in the Name field and click OK
  4. In the feature screen that appears, expand the General option and select Red5Plugin 0.2
  5. On the Install Details panel, just click Next
  6. The review Licenses panel, accept the licenses and click Finish. (Note: if the finish button is available, as it was the first time I tried this, cancel, restart Eclipse, and repeat these steps. Instead of trying to add the site, choose it from the pulldown in step 2)
  7. Eclipse will now install the plug-in.
  8. When installation is complete, Eclipse will prompt you to restart. This is a good idea, so choose Yes.
  9. Congratulations! You now have the plug-in installed. However, there is still some work left to do before you can use the server from within Eclipse. That will be covered in a followup article.

Installing the Red5 Server 0.9 RC1 on Mac OS X

Notes


The following instructions were written with a Mac OS X system in mind. If you are using a different system the instructions will vary slightly.

There are several web sites for Red5, which can make finding the correct location for resources confusing. In the past some of them have been offline for quite a while, and worse may still hold incorrect or conflicting information. Luckily recently the Red5 team has made progress in putting much of the Red5 related material on a single website, www.red5.org.

Unfortunately there are still several official websites floating around. It would be in everyone's best interests if they redirected those other sites to a unified location.

Prerequisites

  1. Java 6, to run Red5. If you are a Mac OS X user on the Intel platform, if you have a 64bit cpu, and are running 10.5 (Leopard) or higher and are up to date, you should already have this. If you are using 10.6 (Snow Leopard), you already have Java 6.

Installation

  1. Go over to the Red5 project page at the new location, http://www.red5.org/wiki/Releases
  2. Click on the 0.9.0 RC1 link.

  3. Ignore the platform-specific download links and just grab the ZIP file. After you click on the link, you may be prompted to download the file. Choose to save the file.

  4. Locate the red5-0.9.RC1.zip file you just downloaded (probably on your Desktop or in your Downloads folder).

  5. Double click on the file. Archive Utility should launch and uncompress the archive.

  6. There should now be a red-0.9.RC1 folder in the same folder as the archive:

  7. Move this folder to your /Applications directory
  8. Congratulations! It really was that simple. If you plan on using the Red5 Plug-in for Eclipse, its best not to try to launch the server just yet and instead move on to installation of the plug-in.

Installing Eclipse 3.5 Carbon Walkthrough

This is a walk-through for installing Eclipse 3.5 on a Mac OS X system. Like the previous article, Installing Eclipse 3.4.2, these instructions will also apply to other platforms with minor modifications.

Note: This article walks you through installing the Carbon version of Eclipse 3.5. As of this writing, the Carbon version of Eclipse 3.5 is required for compatibility with the Adobe Flex 3.2 plug-in.

Prerequisites

You will need Java 5 or greater installed on your machine and configured be in your path. If you are running Mac OS X 10.4 and are up to date, you already have Java 5.

If you are running Mac OS X 10.6 (Show Leopard), you start out with Java 6, which will work fine too. There is no Java 5 available for Snow Leopard.

Installing Eclipse

  1. In a web browser, head on over to http://www.eclipse.org/.
  2. Select the “Download Eclipse” Button on the right
  3. Select the “Eclipse IDE for Java EE Developers” link for your platform, in this case Mac Cocoa 32 bit. Make sure to get the Carbon version!


  4. Select the link to the recommended mirror under "Download eclipse-jee[...] from:".
  5. The download prompt will appear. Choose to save the file.
  6. The browser will now download eclipse.
  7. When the file is complete, the Downloads window will look like this:
  8. Let's now unpack eclipse. Using recent versions of OS X, we can simply find the icon on the desktop (assuming your browser put it here) for the package we just downloaded and double click on it.
  9. After you double clicked on it, Archive Utility should have launched and produced the following popup:
  10. When Archive Utility completes, you should now have a new folder on your desktop named "eclipse":
  11. While you could keep this eclipse folder anywhere, you should move it to your /Applications folder so that it becomes /Applications/eclipse. Before I do so I will rename the folder to eclipse-3.5 both to identify this version and to keep it from conflicting with another eclipse installation already on my machine. If you don't have another version of eclipse installed you don't need to perform this extra step.
  12. Congratulations! You've now installed Eclipse 3.5.

Testing Your Installation

  1. To test your installation, navigate to your install location and launch Eclipse by double clicking on it.
  2. Because I'm running Mac OS X 10.6 and this file was downloaded from the Internet, Finder presents me with this warning dialog:
  3. Choose “Open” to continue opening Eclipse. The warning will only appear the first time you launch Eclipse.
  4. Eclipse should then start loading, with the following loading panel displayed:
  5. Next the “Select a workspace” dialog should appear:
  6. If you don't currently have a workspace, just leave the default. Otherwise choose any other folder in which you want to keep the assorted project files and assets we will be using. Also check the “Use this as the default and do not ask again” checkbox and then hit OK.
  7. Eclipse will continue loading and should eventually show you the welcome page:
  8. Great! If you got this far, you have a good Eclipse installation. Now you can get to work installing any other plugins you need.

Installing the Flex Builder Plugin 3.2 in Eclipse 3.5 Walkthrough

To develop client-side applications in Flex, the best tool to use is Flex Builder. Flex Builder is available as either a standalone application or an Eclipse plug-in. In this walk-through we'll be installing the plug-in version.

The following walk-through was written for Mac OS X 10.6. The instructions should work with minor modifications on Windows and other platforms.

If you are interested in installing on an older version of OS X, see this earlier article on installing Flex Builder 3.2 in Eclipse 3.4.2 on Mac OS X 10.5.

Prerequisites

  1. Java 6. If you have Mac OS X 10.5 or 10.6 and are up to date, you have Java 6.
  2. Eclipse 3.5 JEE, 32 bit, Carbon

Installation

  1. Head over to the Flex Builder download page and download the Flex Builder plugin for Eclipse. Make sure you grab the Eclipse plug-in version - not the first option - to avoid having to download two large files instead of one!

    Note that for Flex 4, Flex Builder has been renamed Flash Builder, so the download page and links will likely be different in the future.
  2. After the file has completed downloading, locate it on your system. If you are on Mac OS X, you just downloaded a disk image. Mount the disk image by double-clicking on it.
  3. Now run the installer. It should be named FB_Plugin_Mac_Installer.
  4. Note: If you have recently installed Mac OS X 10.6, you may now see the following dialog:

    If you don't see this dialog, great! Just continue at the next step. But if you do see the above dialog, don't fear. The reason you see it is because you are on an Intel mac and the installer is a PowerPC (ppc) application. Yes, sadly, not all applications are Universal Binaries. Luckily it isn't a big deal to install Rosetta. Just click the "Install" button on the dialog. You should then see Software Update find the correct update to apply:

    When the installation of Rosetta is complete, you'll see this dialog:

    Now go back to Finder and relaunch the installer.
  5. When the installer launches, Mac OS X will warn you that this application was downloaded from the Internet. That's OK, so click Open.
  6. The installer will prompt you for your language. Select what you want to use click OK.
  7. Click next at the Introduction panel
  8. Select the radio button next to "I accept" and click Next
  9. At the Choose Install Folder panel, you can accept the default location. In my case I already have Flex Builder installed, so I will choose an alternative location named "Adobe Flex Builder 3.2 Plug-in". Then click Next.
  10. At the Choose Eclipse Folder panel, click the Choose button and navigate to your Eclipse folder. In the "Installing Eclipse 3.5" walkthrough we installed into /Applications/eclipse-3.5, so I've selected this folder. Then click Next.
  11. You should see a dialog appear that says "Supported version of Eclipse not found". Just click "Proceed with Caution".
  12. At the Additional Installations panel, it is suggested that you uncheck the option to install Adobe Flash Player 9. You should manually install the latest Flash Player 10 debug player later. You may also install JSEclipse if you will be doing any JavaScript development (e.g. an HTML-based AIR application). After you've made your decision, click Next.
  13. You should now see the Pre-Installation Summary panel. Click Install.
  14. The installer will now take a few minutes to perform the installation.
  15. When the installation is complete, you should see the following Install Complete panel.
  16. Congratulations! You've now installed the Flex Builder 3.2 plug-in for Eclipse 3.5.