Thursday, September 10, 2009

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!

3 comments:

tigerbajs said...

Hi!

I am getting this error when I followed your tutorial.
Starting Red5
Listening for transport dt_socket at address: 8787
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file

Does this have anything to do with Java version. Seems like Eclipse is running on 1.5 but my Red5 is running on 1.6. Can I change Java version for Eclipse?

Thanks in advance!

CHIDHA said...

i configured same as above in windows i get the error saying d:/program is not recognized as an internal or external command my red5 installation folder was d:/programfiles/red5

Alex said...

@CHIDA: I haven't tried this on Windows, but it obviously looks like its a problem with the space in "Program Files". Can you run red5 from a Console (CMD) window directly, skipping the red5 plugin? If not, its a problem with the red5.bat file and you can try editing that. If you can run it from CMD, then the easiest thing is to do is to move your red5 installation to a directory without a space in it (e.g. D:\Red5\).

Post a Comment