Azureus or Vuze is one of the best bit torrent clients out there. Written in Java, it is cross platform and the developers are Java gurus who have brought the best of Java to the best of OpenSource in a truly fanstastic bit of software.
However, as with most things Java, when an installation or upgrade fails, most users are left out there in the cold. And one of the most common ways for an Azureus upgrade or installation to fail is with this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Layout
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Layout
at java.security.AccessController.doPrivileged(Native Method)
Could not find the main class: org.gudy.azureus2.ui.common.Main. Program will exit.
It looks nasty, but actually the problem is very simple. What this is telling you is that the Azureus startup cannot find the jar file that has log4j in it. For example, log4j-1.2.15.jar. The solution is to tell the JVM where to find this on your system when Azureus starts up.
In kubuntu, which we prefer to use at Kieser.net, the azureus startup command is a shell script located here:
The contents of this script look like something this (it will differ slightly in each installation depending on the Java that you have installed):
if [ -z $VUZE ]; then
exec $JAVA -Djava.library.path=/usr/lib/jni:/usr/lib \
-classpath /usr/share/java/Azureus2.jar:$JARS \
Note the line
This sets the variable $JARS which is passed as the classpath to the Java command. We need to add out log4j.jar path to that variable. This is what the file /usr/share/java-config/libswt-3.4-java looks like on our desktops:
So, locate where your log4j jar file is, then add it to this list. Here is what ours looks like:
Now you can start up Azureus and all will be well!
If you haven't got log4j installed on your system, then you need to install it first. Most linux distributions have packages for log4j and you simply need to install that package using the package manager. But don't expect that installation to then add the jar file to the Azureus startup! It doesn't know to do that, so you need to manually edit the script that runs Azureus and sets the classpath as we have shown above.
Please note that Kieser.net is strictly against illegal file sharing. We support only legal and legitimate use of this technology, preferably use that promotes and helps OpenSource software adoption.