I’ve been working with Red5 lately, and the lack of good introductory documentation is disturbing. So I’ve watched many of the tutorials, screencasts, and asked questions for you. I’ll be explaining here all the things you need to start working with Red5 (1.0 RC1). I’m assuming knowledge of administration tasks, Java, and some of the technologies involved. As such, my goal is to tell you what you need to do, not how to do it. There are other resources that explain that far better than I ever could.
Specifics: This is a checklist to compile Red5 from SVN from within Eclipse.
Please contact me if you spot something that’s wrong. I’ll update the post and give you credit.
To start working with Red5, you’ll need to set up your development environment first. You have two options for how to run Red5, but I’m only going to cover a standalone server, since deployment to a J2EE container is slightly more complicated, and more importantly, I haven’t done it.
So our shopping list is:
- JDK <= 1.6
- Apache Ant
- Apache Ivy (I’m not sure if this is necessary, but better safe than sorry)
- A SVN client (Subclipse, TortoiseSVN, Subversive)
- Eclipse with plugins:
Once we’ve installed all these, and set up the environment variables, you should be able to check out the source (or download the tarball) and build the project, hopefully without issue.
In order to build Red5 from within eclipse, you need to add the binaries for ant to your PATH. In order to run Red5, you need to define JAVA_HOME to point to the root of your jdk install.
The code for Red5 is hosted on googlecode, so point your browser there to see the latest info about checking out from source.
Ok, now you’ve noticed that I give several options for some of the requirements. For reference, I used: Eclipse Helios SR1 Java EE edition, JDK 1.6.0_23, ant 1.8.2, Ivy 2.2.0, TortoiseSVN, and the rest are the latest public releases (as of February 26, 2011).
Checking out and compiling
So you need to checkout the source (which includes an eclipse project), and then import that project into your workspace. Open the build.xml file and run the dist target. This will compile Red5 into the standard standalone distribution.
If you aren’t as lucky as the rest of us, you might run into some common issues. The ones that I’ve run into personally are:
Ivysettings.xml cannot be found: caused by a bug in IvyDE, which doesn’t handle URLs with spaces correctly. Fixed for the next version (after 2.1.0), so the workaround now is to move your workspace to a path without spaces (a good idea anyways).
class Logger cannot be found: this is the same as above.
Problems compiling: Make sure that you have the proper JDK installed (I was successful with 32bit jdk)
Problems running Red5: Make sure you have the JAVA_HOME environment variable set to the root of the jdk.
I always try to teach a small lesson with every piece of speech. As such:
We need the JDK for obvious reasons, since it’s a Java-based project.
Apache Ant is a task-oriented build tool that is used by the project for the build scripts.
Apache Ivy is a dependency resolution tool that is used to resolve library dependencies (and Red5 has a ton of those!).
You need a SVN client to checkout the source, so this is optional if you just download the source tarball.
Eclipse needs to be the Java EE version, since Red5 is at its core, a J2EE application. In standalone mode, it runs an internal Jetty container, but it can be deployed as a WAR to an existing container (such as Tomcat or GlassFish).
IvyDE is a plugin for Eclipse that integrates Ivy, so Eclipse is aware of the dependencies that need to be resolved and added to the build path.