NoClassDefFoundError Amanuensis  NoClassDefFoundError Amanuensis

go to home page Student Projects full screen, hide local find menu Google search web for more information on this topic jump to foot of page translate this page with Babelfish by Roedy Green ©1996-2008 Canadian Mind Products

This essay is about a suggested student project in Java programming. This essay gives a rough overview of how it might work. It does not describe an actual complete program. I have no source, object, specifications, file layouts or anything else useful to implementing this project. Everything I have to say to help you with this project is written below. I am not prepared to help you implement it; I have too many other projects of my own.

I do contract work for a living, which could include writing a program such as this. However, I don’t do people’s homework for them. That just robs them of an education.

You have my full permission to implement this project any way you please.

This project is similar to the Java Jar Catalog. This project is designed to help when you get the dreaded NoClassDefFoundError.

When you get a NoClassDefFoundError, essentially the problem is the place and name where you put the class file, free-standing on disk or inside a jar, does match the place and name it should have, based on the classpath, the package name and the class name. Everything is case sensitive, and sensitive to the tiniest typo. Unfortunately, there is currently no tool to tell you where the class should be placed (usually there are several possibilities) or where it is now. It works using a twelve step process:

  1. You enter the package and class mentioned in the NoClassDefFoundError message that could not be found.
  2. By default the classpath is set from the default classpath.
  3. You then get to override the classpath to the one in use at the time.
  4. Then the program checks the classpath to see if indeed the class is missing. If not, the classpath specified is not the one the amanuensis is using or the class name is not the same as the error message.
  5. Then the amanuensis scans the classpath looking for a class in the same package that matches ignoring case.
  6. Then the amanuensis scans the classpath looking for a class in a package that matches ignoring case of both the package and classpath.
  7. The amanuensis chastises the user if the any package, found or searched for is not fully lower case or any class does not start with a capital letter and contain at least one lower case letter.
  8. If the amanuensis still can’t find the class, it searches for a match using soundex on the package and class name. This hopefully will find something that sounds the same.
  9. If the amanuensis still can’t find the class, it finds the top 10 closest matches. Define distance between two Strings by counting up how many of each letter there is in each. Add up the absolute value of the differences, subtract one for each exact matching character in the corresponding slot working from the front and, subtract one for each matching character in each slot working from the end. You will often end up with a negative number for a very good match.
  10. If the user says none of these 10 is the one, the amanuensis prepares an index of all jars and classes on all the hard disks, and repeats the previous processes.
  11. If the user says this process still has not found it, the amanuensis uses an index of jars that are commonly installed but not necessarily present on this machine, e.g. JavaMail, Activation Framework, Tomcat, Struts, Resin…
  12. If the users says that still has not found it, suggest go getting drunk and trying again tomorrow.

CMP homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.59] The information on this page is for non-military use only.
You are visitor number 6,418. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/project/noclassdeffounderror.html J:\mindprod\project\noclassdeffounderror.html