Search code examples
antjarlog4jred5

Java errors when trying to compile a Red5 server sample


I'm trying to a build a Red5 server sample using the tutorial here. I have done all the things including adding red5.jar, commons-logging-1.1.1.jar but when i try to build the my own jar file using ant I get the following errors!

Buildfile: C:\Users\MediaStudio\workspace\Sample\build.xml
clean:
compile:
    [javac] C:\Users\MediaStudio\workspace\Sample\build.xml:8: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 1 source file to C:\Users\MediaStudio\workspace\Sample\classes
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.5
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:4: error: package org.apache.commons.logging does not exist
    [javac] import org.apache.commons.logging.Log;
    [javac]                                  ^
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:5: error: package org.apache.commons.logging does not exist
    [javac] import org.apache.commons.logging.LogFactory;
    [javac]                                  ^
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:6: error: package org.red5.server.adapter does not exist
    [javac] import org.red5.server.adapter.ApplicationAdapter;
    [javac]                               ^
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:7: error: package org.red5.server.api does not exist
    [javac] import org.red5.server.api.IConnection;
    [javac]                           ^
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:8: error: package org.red5.server.api does not exist
    [javac] import org.red5.server.api.IScope;
    [javac]                           ^
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:12: error: cannot find symbol
    [javac] public class Application extends ApplicationAdapter{
    [javac]                                  ^
    [javac]   symbol: class ApplicationAdapter
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:14: error: cannot find symbol
    [javac] private static final Log log = LogFactory.getLog(Application.class);
    [javac]                      ^
    [javac]   symbol:   class Log
    [javac]   location: class Application
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:17: error: cannot find symbol
    [javac] public boolean appStart(IScope app){
    [javac]                         ^
    [javac]   symbol:   class IScope
    [javac]   location: class Application
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:26: error: cannot find symbol
    [javac] public boolean roomStart(IScope room){
    [javac]                          ^
    [javac]   symbol:   class IScope
    [javac]   location: class Application
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:35: error: cannot find symbol
    [javac] public boolean roomConnect(IConnection conn, Object params[]){
    [javac]                            ^
    [javac]   symbol:   class IConnection
    [javac]   location: class Application
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:44: error: cannot find symbol
    [javac] public void roomDisconnect(IConnection conn){
    [javac]                            ^
    [javac]   symbol:   class IConnection
    [javac]   location: class Application
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:50: error: cannot find symbol
    [javac] public void appDisconnect(IConnection conn){
    [javac]                           ^
    [javac]   symbol:   class IConnection
    [javac]   location: class Application
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:14: error: cannot find symbol
    [javac] private static final Log log = LogFactory.getLog(Application.class);
    [javac]                                ^
    [javac]   symbol:   variable LogFactory
    [javac]   location: class Application
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:18: error: cannot find symbol
    [javac] if(super.appStart(app) == false){
    [javac]    ^
    [javac]   symbol:   variable super
    [javac]   location: class Application
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:27: error: cannot find symbol
    [javac] if(super.roomStart(room) == false){
    [javac]    ^
    [javac]   symbol:   variable super
    [javac]   location: class Application
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:36: error: cannot find symbol
    [javac] if(super.roomConnect(conn, params) == false){
    [javac]    ^
    [javac]   symbol:   variable super
    [javac]   location: class Application
    [javac] C:\Users\MediaStudio\workspace\Sample\src\org\xyz\Application.java:45: error: cannot find symbol
    [javac] super.roomDisconnect(conn);
    [javac] ^
    [javac]   symbol:   variable super
    [javac]   location: class Application
    [javac] 17 errors
    [javac] 1 warning

BUILD FAILED
C:\Users\MediaStudio\workspace\Sample\build.xml:8: Compile failed; see the compiler error output for details.

I'm using the classic version of Eclipse (not sure if it's important or not but!)


Solution

  • I solved this problem by adding the classpath attribute to the javac command inside the build file pointing to the right jar files like the line below:

    classpath="${lib.dir}/red5.jar:${lib.dir}/commons-logging-1.1.1.jar"