Wednesday 20 January 2010

Azureus/Vuze fails to start - java.lang.NoClassDefFoundError: org/apache/log4j/Layout

Think bit torrent and most people think illegal file downloads. However, many OpenSource products and vendors use bit torrent distribution and it is part of the backbone of the OpenSource movement.

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.net.URLClassLoader$1.run(URLClassLoader.java:217)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:205)

at java.lang.ClassLoader.loadClass(ClassLoader.java:323)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)

at java.lang.ClassLoader.loadClass(ClassLoader.java:268)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)

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:

/usr/bin/azureus

The contents of this script look like something this (it will differ slightly in each installation depending on the Java that you have installed):

#!/bin/sh

JAVA='/usr/lib/jvm/java-6-openjdk/jre/bin/java -Xmx1024M'

/usr/share/java-config/libswt-3.4-java

if [ -z $VUZE ]; then

UI=-Dforce.ui=az2

fi

exec $JAVA -Djava.library.path=/usr/lib/jni:/usr/lib \

-classpath /usr/share/java/Azureus2.jar:$JARS \

-Dazureus.install.path="$HOME/.azureus" \

$UI \

org.gudy.azureus2.ui.common.Main "$@"


Note the line

./usr/share/java-config/libswt-3.4-java


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:

JARS=/usr/share/java/swt-gtk-3.4.jar

So, locate where your log4j jar file is, then add it to this list. Here is what ours looks like:

JARS=/usr/share/java/swt-gtk-3.4.jar:/usr/share/java/log4j-1.2.15.jar

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.

Honeypot: spam@kieser.net

55 comments:

  1. Awesome post. You Post is very informative. Thanks for Sharing.
    .Net Course in Noida

    ReplyDelete
  2. Good job! Fruitful article. I like this very much. It is very useful for my research. It shows your interest in this topic very well. I hope you will post some more information about the software. Please keep sharing!!
    Java Training in Chennai
    Java Training in Coimbatore
    Java Training in Bangalore

    ReplyDelete
  3. Awesome blog thanks for sharing Masters of building brands, Adhuntt Media is making waves in the Chennai digital market! Known for their out of their box ideas, if a creative overhaul for your brand is what you need, you’ve come to the right place.
    digital marketing company in chennai
    seo service in chennai
    web designing company in chennai
    social media marketing company in chennai

    ReplyDelete
  4. Nice blog thanks for sharing Wondering where to buy healthy garden plants in Chennai for your home? Karuna Nursery Gardens offers you with tons of variety and organic choices suitable for our tropical climate. Make your garden fabulous with Karuna Nursery.
    plant nursery in chennai
    rental plants in chennai
    corporate gardening service in chennai

    ReplyDelete
  5. Great post! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here.
    Advertising Agency
    3d Animation Services
    Branding services
    Web Design Services in Chennai
    Advertising Company in Chennai

    ReplyDelete
  6. I'm more than happy to uncover this web site. I want to to thank you for your time due to this wonderful read!! get I definitely appreciated every bit of it and I have you saved to fav to see new information in your web site.

    ReplyDelete
  7. Your information about asp is really interesting and innovative. Also I want you to share latest updates about asp. Can you update it in your website? Thanks for sharing.

    Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery

    ReplyDelete
  8. Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.

    SAP HANA Online Training

    SAP HANA Classes Online

    SAP HANA Training Online

    Online SAP HANA Course

    SAP HANA Course Online

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. I'm really very happy to read your blogs best sites.

    ceramic coating in chennai

    ReplyDelete
  11. I'm glad that I found this page thank you for such an valuable information.

    Buy Home Theatre Systems In Chennai

    ReplyDelete
  12. Best Bet365 Casino and Sportsbook - VieCasino.com
    Find the best bet365 casino and sportsbook. bet365 Exclusive deals 카지노사이트 on Bet365 Casino and Sportsbook and get a 100% 더킹카지노 deposit bonus.

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete

  14. IMBMS is amazing Glutathione store in India, which are the main reason behind its popularity among customers. But before buying this product, you must make sure whether the ingredients present in the vita glow night cream are suitable for your skin or not. There are some ingredients, which may cause allergy to you and your skin and if you have sensitive skin then it may result in complications. So it is recommended to take the advice of a doctor before using any such cream. If you are not able to find a good doctor who can guide you regarding your skin then researching on the internet would be beneficial for you to find a good night cream.
    IMBMS

    ReplyDelete
  15. Well done! I am really glad to read your fantastic posting and keep sharing...
    Sole custody Virginia
    Protective Order Virginia
    Emergency Protective Order

    ReplyDelete
  16. Likewise, an independent spot net software engineer, or an independent asp.net designer acclaim .Net innovation for accelerating the improvement processes, creating applications effectively to fulfill organizations' prerequisites. .Net's libraries, useful improvement usefulness (Xamarin, General Windows Stage, Normal language runtime,etc.), cross-stage plan, well disposed upkeep chances, and a reliable storing framework tempt the developers into working with it, realizing that anything made by the method for the .Net system's highlights and potential outcomes won't dishearten a client and fill the need as it is expected on the necessities' rundown>> .net developer hourly rate

    ReplyDelete
  17. This comment has been removed by the author.

    ReplyDelete
  18. Hello! Our it outstaffing company provides several types of services that you can choose from for your project - short-term and long-term outstaffing services. On our website you can learn more about the characteristics of each of these services and choose the most suitable option for yourself. Go ahead and read!

    ReplyDelete
  19. If your business or startup needs a profitable solution when hiring angular developers to the team, then we can advise you to hire these developers on an hourly basis from Ukraine. We will take over the calculation of the angular developer hourly rate along with the search and hiring of the developers you are interested in.

    ReplyDelete
  20. This comment has been removed by the author.

    ReplyDelete
  21. Hello everyone, I want to recommend you a site where you can learn everything about cloud server automation and the process of hiring top employees for your company in this area! This can help you decide which services are best for your company or business! You should definitely visit this site! Good luck and have a nice day!

    ReplyDelete
  22. The big advantage of bot build operate transfer consulting is that this model can be used in any industry. This, as a rule, helps enterprises to make development more qualitative. Looking to hire a professional who can use the BOT model to develop projects? We will select for you the best professional in his field.

    ReplyDelete
  23. To correct your mistakes without any hassle, all you have to do is visit the site and check the proper structure of your sentences. You can use the compound sentence checker to correct mistakes. You can do this by copying and pasting your text into the box, or by typing your sentences directly into it. When done, you can start submitting text by pressing the button to do so. Wait a few seconds and the results will come back to you.

    ReplyDelete
  24. Hello! If your AI works with speech recognition software and highlighting the components that interest you? In order to correctly describe the information for your AI about the intentions of the user in the pictures, you need specialists provided by our company! We help you to select only high-quality specialists in this business.

    ReplyDelete