Setting up Eclipse for Red5 Development

I’ve been playing with Red5, an open source alternative to Adobe’s Flash Communication Server. My Eclipse setup just died on me, so in the process of setting up eclipse for developing the Red5 server, I’ll put up a quick tutorial on using eclipse to work with Red5. Note that this is aimed more towards hacking on Red5 itself than writing applications that use Red5, although the latter will definitely benefit from starting with the setup I’ll be doing.

Tools we will be installing:
- JDK SE 1.6
- Eclipse SDK (Eclipse Classic)
- Spring IDE plugin for Spring development
- IvyDE for dependency management using the Ivy system.
- Subclipse for SVN management

We want to do some serious java development, so we’re going to need the Java Development Kit… Or, as it is now known, the Java Standard Edition. Download the current JDK and install.

Next, we need Eclipse itself. I grabbed Eclipse Classic (Eclipse SDK) from Eclipse’ Downloads section. Another good alternative to start from is the Expert Java build from EasyEclipse. Download the zip file and extract it to some directory. I prefer C:\Program Files\eclipse for windows, or /home/njoubert/eclipse for Ubuntu.

NOTE: If you want FlexBuilder as a plugin inside your eclipse install, you should install flexbuilder NOW before doing anything else. There seems to be some conflicts when FlexBuilder plugin gets installed after other 3rd party plugins are present or something…

Open up Eclipse, and select whatever directory you want as your workspace. If you already have Red5 checked out somewhere, you can make the directory that Red5 lives in as your workspace, or you can choose some other one, and we will associate the already-checked-out code with the workspace you select a little later.

Once Eclipse is running, we want to associate Eclipse with our shiny JDK that we downloaded instead of sitting on top of the built-in JRE. Go to Window > Preferences… and open Java > Installes JREs. It should show only the supplied jre (jre1.6.0_01 for my Eclipse 3.3.0). Hit “Add…”, then “Browse” for a JRE home directory. (aka. “C:\Program Files\Java\jdk1.6.0_01″). Everything should pop up. Hit OK, and make sure to select the new JDK in the list of Installed JREs. Hit OK, and you’re good to go.

Now we need to get IvyDE and the Spring IDE installed. The Spring IDE is technically not necessary, and I tend to not use it in the areas of Red5 i’m working on, but Red5 is built on top of Spring, so it’s worth installing it and removing later on if you think it is unnecessary. Eclipse plugins all follow the same installation procedure, so i’ll be a bit more detailed with the first plug-in, and then roll with it for the rest.

Spring IDE 2.0 plays well with Eclipse Europa’s Java Development edition, since this Eclipse build comes with Mylyn, which Spring plugs into. Mylyn is a fancy task manager that does all kinds of cool stuff, which i’m not going to go into now, but it worth looking at.

Spring IDE has an Eclipse update site, that Eclipse uses to install the plugin from. go to Help > Software Updates > Find and Install.. in Eclipse, select “Search for new features to install” and hit next. Current known sites pop up. Select “New Remote Site…” and set the URL to http://springide.org/updatesite/ and name to “Spring” (or whatever you want). Make sure there’s a check next to it, and hit “next”. After contacting the site, Eclipse should show “Spring” as a feature to install. Check it, and click Next. Accept the terms and select Finish. Click finish to start the installation procedure. Eclipse will first download the necessary utilities, then prompt you to install them. Restart Eclipse when prompted to.

Once Eclipse comes back, we follow the same procedure to add IvyDE to Eclipse. There is a good tutorial on the Red5 wiki on installing IvyDE and using it with Red5. For the moment, follow the previous procedure, with the update site “http://www.jaya.free.fr/update”.

Lastly we want to get Subversion compatibility for Eclipse, so we need Subclipse. You can follow the same procedures as before, this time with the update site “http://subclipse.tigris.org/update_1.2.x”. When it prompts you for which features to install, open up the Subclipse item and deselect Integrations. Some of the integration plugins is not installed, so i just skip that part.

To get the current Red5 source from scratch, go to File > New > Project… and choose SVN > Checkout projects from SVN. Select “Create a new repository location” and use the URL “http://svn1.cvsdude.com/osflash/red5″ in the next section. Eclipse should resolve this and download a Table of Contents from which you can select what you want to check out. Browse to java > server, select “trunk” and go for it! This should check out and try to build Red5.

If you already have a copy on disk of Red5, I opted for a File > Import > File System, and imported the root Red5 directory. Once this was in my workspace, I right-clicked on the project, and selected Team > Share…, at which point SVN should kick in and realize that this is a current SVN project and associate the project with the right repository.

To get Ivy running with your local checkout copy of Red5, you need to set some non-obvious preferences. Open up Window > Preferences > IvyDE in Eclipse. Each of the fields needs to be filled out before Ivy will start doing its job. Point the IvyConf URL to the ivyconfig.xml file that is in the root of the Red5 folder. Fill in Accepted types, Sources types and Javadoc types as in the examples below each. I checked “Do a trtrieve after resolve” and set up the Pattern to their example, although I believe you can get away by not doing this. When you click “OK”, Ivy should start running and resolving dependencies.

Voila, Red5 is ready to run! Launch it by going to src > org.red5.server and running Standalone.java as a Java application.

8 Comments

  1. infrid says:

    thanks a lot man.

    I was totally stuffed, unable to get past a bug in red5 and didn’t know how to build trunk.

    Really grateful for this help.. I built the trunk and can now finish building the app. I might even be able to contribute one day too (assuming my java boogie get’s a bit more woogie to it).

  2. Hemang says:

    In RED5, standalone.java is running successfully, but While debugging Standalone.java in RED5, i am getting “Source was not found” error. It is indicating that the source attachment does not contain the sorce for the file Object.class and asking to change the source attachment.

    So i can’t debug the code further more. I want to know about how RED5 is accepting request (handshaking with client) and how it converts source into RTMP format.

    You are requested to do some needful as i really need it

  3. Niels Joubert says:

    Thanks for the comments guys. I am no longer actively working on Red5, having moved on to some other projects, so im sorry i can’t answer questions off the bat anymore. I suggest talking to the Red5 community directly through the mailing lists on http://www.osflash.org/red5

  4. Eric says:

    it did not work, for me.

    I’m trying with Eclipse 3.4, I can’t resolve the EquinoxP2 dependency…

  5. David says:

    I took the full Eclipse IDE for Java EE Developers (Ganymede) and managed to sort it all out. You will get dependency problems if you try to take more than the Spring Core plugin.

  6. Fred says:

    Any chance of a full update on these instructions for the latest builds? Is it the same for the latest .8 red5 and latest eclipse & JDK?

    one other q: My red5 is on my server on a shared network drive – Do I just point my working directory to the red5 folder on the server? Spring is now there I am told, because I had to copy some of the code from the server to my local workspace – dose that makes sense to point it instead to my dev servers red5 root folder?

  7. Niels Joubert says:

    Hi Fred.

    Unfortunately not all of this is true for the latest Red5 anymore. I’m actually really struggling to get it to work for me at the moment. If I get Red5 running again I’ll write another tutorial.

    You should be able to point to your network drive for files just fine

  8. plus d'informations says:

    plus d’informations…

    EECS from the Trenches » Blog Archive » Setting up Eclipse for Red5 Development…