Apache Ant 1.7 and above is required for building the Red5 project source code. download here http://archive.apache.org/dist/ant/binaries/
The path to the ant binary must be on your system PATH environment variable (test by typing ant -version at a system prompt) defined, typically
PATH=$PATH:/usr/local/ant
You can check this on windows by typing set PATH or on unix by typing echo $PATH
Java 1.5 or 1.6 and above is required for running ant, compiling the source and running the Red5 server.
Download Java 5 http://java.sun.com/j2se/1.5.0/download.html
Download Java 6 http://java.sun.com/j2se/1.6.0/download.html
You must have the environment variables for JAVA_HOME and JAVA_VERSION defined, typically
JAVA_HOME=C:\development\j2sdk\1.5.0_07 JAVA_VERSION=1.5
You can check this on windows by typing
set JAVA_HOME
or on unix by typing
$ echo $JAVA_HOME
You must have the environment variables for RED5_HOME defined, typically
RED5_HOME=/www/red5_server
![]() | Warning |
---|---|
FAILURE TO SETUP YOUR ENVIRONMENT VARIABLES WILL PREVENT YOUR FROM BEING ABLE TO BUILD PROPERLY |
![]() | Note |
---|---|
You don't need netbeans or eclipse unless you need an IDE for java. Download Netbeans Download Eclipse |
The Red5 source code is available at the google code project page and svn repository.
With your favourite SVN client check out the source code from svn at this address http://red5.googlecode.com/svn/java/server/trunk/ or https://red5.googlecode.com/svn/java/server/trunk/ if you have a google code login.
Team members will be added to the google code project group and in your google code login you will find the svn password for committing changes at this address http://code.google.com/hosting/settings.
With your favourite SVN client check out the source code from svn at this address http://red5.googlecode.com/svn/java/example/trunk/ or https://red5.googlecode.com/svn/java/example/trunk/ if you have a google code login.
With your favourite SVN client check out the source code from svn at this address http://red5.googlecode.com/svn/flash/trunk/ or https://red5.googlecode.com/svn/flash/trunk/ if you have a google code login.
To build the red5 source simply run the following command from the command line inside the red5 source directory.
$ ant dist
all - Runs clean, prepare, compile, jar, javadoc targets
bootstrap - Compile and start the server using the bootstrap class
checkout - checks out the Red5 server source (requires svnant.jar)
checkout-all - checks out the entire Red5 project sources from the root level to a specified directory
clean - cleans up all the files and directories
compile - Compiles Red5
compile_core - Build Red5 server sources and downloads java 6 dependancies
compile_core_compatibility - Build Red5 server sources and downloads java 5 dependancies
compile_demos - Copies over the root and installer webapp
compile_script - Compiles scripting sources
compile_tests - Compiles junit test classes
compile_war - Compiles Red5 into a war distribution
console - launches a non-SSL jconsole for managing Red5 in JMX.
console-ssl - launches a SSL jconsole for managing Red5 in JMX with SSL enabled.
doc-all - Generate docbook documentation for html-single, multi html and pdf.
doc-clean - Cleans the docbook files.
doc-html - Compile reference documentation to chunked html.
doc-htmlsingle - Compile reference documentation to single html.
doc-pdf - Compile reference documentation to pdf.
doc-prepare - Extra preparation for the documentation.
dist - Make Binary distribution.
dist-archive - Create archive file for distribution.
dist-cluster - Create Edge/Origin distribution.
dist-debian - Create Debian package.
dist-edge - Builds a Red5 edge distribution.
dist-origin - Builds a Red5 origin distribution.
dist-installer - Make Installer distribution.
dist-macosx - Create Mac OSX installer.
dist-windows - Create Windows installer.
dist-redhat - Create Redhat installer.
ivyclear - Clears out the Ivy cache.
jar-determine-classpath - Determine classpath for jar file.
jar - Make Archive.
javadoc - Generate JavaDoc.
java6.check - Checks for Java 6.
prepare - Prepares for building Red5.
server - Compile and start the server.
shutdown - Shuts down the running Red5 instance.
udp_server - Compile and start experimental UDP server.
run-tests - Run JUnit tests and generate HTML reports.
run-tests-systemtest - Runs some end-to-end system tests against a test server using a flash client.
run-tests-server - Run the selftest server.
svn-add - Add files to svn.
remotejar - Creates a jar that may be deployed with remote applications.
retrieve - Retrieves the libraries if needed.
rtmps_keystore - Creates the keystore file in the conf directory required by RTMPS.
truststore - Creates a duplicate keystore file and generates a truststore file for jconsole SSL connections.
upload-snapshot - Uploads a snapshot of Red5 to the repository.
war_demos - Build wars for demo apps.
webwar - Make Web Archive.
This guide assumes eclipse 3.1.0 and you have downloaded the entire red5 build from the subversion repository at https://red5.googlecode.com/svn/java/server/trunk
The following plugins are recommended or required for building red5 in eclipse.
IvyIDE - http://ant.apache.org/ivy/ivyde/download.cgi. See here for installation / update instructions
Spring IDE - http://springide.org/project/wiki
Subclipse SVN Plugin - http://subclipse.tigris.org/
There are two ways to import the Red5 project. Either import an already downloaded working copy of the Red5 project or import the project directly from SVN.
Procedure 6.1. Import the checked out working copy.
Start Eclipse.
Begin to import project
→In the Import dialog box select the item
and hit .Hit the Select root directory text box.
button next to theSelect the root folder where you downloaded the red5 repository,(e.g. c:\projects \osflash\red5 or /www/red5_server) and hit ok.
Make sure red5 is selected in the projects area and hit
.Eclipse should automatically build the project, you can force a build from the menu
→Procedure 6.2. Import the project working copy from SVN. (Subclipse must be installed).
Begin to import project
→In the Import dialog box select SVN and then select the item
and hit .A list of available SVN urls will be available, if it is not available select http://red5.googlecode.com/svn/java/server/trunk or.\ https://red5.googlecode.com/svn/java/server/trunk if you have a google code login.
click and enter.Click
.Eclipse should automatically build the project, you can force a build from the menu
→Procedure 6.4. Debugging Red5 in Eclipse.
Click the arrow next to the icon menu and then click .
Click
in the menu then right click and .Type a name for the debug configuration (ie Red) and type org.red5.server.Bootstrap as the main class.
Select the
tab.In the Program Arguments enter
-Dlogback.ContextSelector=org.red5.logging.LoggingContextSelector -Dcatalina.useNaming=true -Djava.security.debug=failure
In the VM Arguments enter
-cp ./conf
In OSX with JDK 5 and JDK6 to specify JDK6 the PATH variable has to be set. Goto the Environment Tab, add a new variable called PATH, and place this in there.
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin
Click
and .Goto the build configure path dialog
→In the src/conf directory.
tab choose and select theMake sure "Allow output folders for source folders" is selected.
Under red5_server/src/conf, select Output Folder and choose .
Select Specific Output Folder, select the root directory and choose "create new folder" and choose "conf".
Select conf, the output folder for the Red5 configs will now be placed into red5_server/conf.
With the imported red5 project selected click the debug icon and it will launch the server.
Console logging will appear in the console window.
If you get an error in the console like:
java.net.BindException: Address already in use: bind at sun.nio.ch.Net.bind(Native
Method) at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown
Source) at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) at
org.apache.mina.io.socket.SocketAcceptor.registerNew(SocketAcceptor.java:362)
at org.apache.mina.io.socket.SocketAcceptor.access$800(SocketAcceptor.java:46)
at org.apache.mina.io.socket.SocketAcceptor$Worker.run(SocketAcceptor.java:238)
Exception in thread "main"
Then the socket red5 wants to run is in use, you can change the socket port in the property rtmp.port in the property file red5.properties.
When cleaning the dependancy libraries using ant and ivy with the following command
$ ant ivyclear
It is required to run the rebuild of Red5 in a particular way to make sure ivy retrieved the libraries correctly.
$ ant -Divy.conf.name="java6, eclipse" dist
Then back in eclipse right click the ivy.xml in the project and click it will also resolve the libraries in Eclipse.