MustEat.org

Last updated: 12:17AM 12/04/08

Why?

I needed to enable Log4j to make use of the SyslogAppender in a Linux environment. If the Juli logger was capable of this I wouldn’t have bothered.

What you need to know

You have to use JDK 1.5. The instructions presented here say 1.5.x or later, but they apparently mean 1.5 line ONLY. JDK 1.6 can not compile the DBCP dependency due to a backwards incompatible change in the Java core classes. For more information see the bug here.

Now if you are like me, you have the 1.6 JDK setup in a build environment to be used by default. Since my setup is localized to a batch script I launch a powershell environment from, all I need to do was modify the parts of the environment to point to the correct Java version. I need to put the 5 JDK Bin into my path above everything else, and update the JAVA_HOME environment variable.

This being powershell, this was a pretty simple task.


PS Z:\> $env:JAVA_HOME = "D:\dev\java\jdk1.5.0_15"
PS Z:\> $env:path = $env:JAVA_HOME + "\bin;" + $env:path
PS Z:\> java -version
java version "1.5.0_15"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04)
Java HotSpot(TM) Client VM (build 1.5.0_15-b04, mixed mode)
PS Z:\> $env:ANT_HOME
D:\dev\Java\ant\apache-ant-1.7.0

Then to compile


PS D:\dev\Java\EE\Tomcat\6.0.18\apache-tomcat-6.0.18-src> ant clean-depend
PS D:\dev\Java\EE\Tomcat\6.0.18\apache-tomcat-6.0.18-src> ant download
PS D:\dev\Java\EE\Tomcat\6.0.18\apache-tomcat-6.0.18-src> ant
PS D:\dev\Java\EE\Tomcat\6.0.18\apache-tomcat-6.0.18-src> ant -f extras.xml

Tags:
weblog Tomcat Syslog Log4j Juli 6 compile Ant JDK