image provider

NoClassDefFoundError Amanuensis


This essay does not describe an existing computer program, just one that should exist. This essay is about a suggested student project in Java programming. This essay gives a rough overview of how it might work. I have no source, object, specifications, file layouts or anything else useful to implementing this project. Everything I have prepared to help you is right here.

This project outline is not like the artificial, tidy little problems you are spoon-fed in school, when all the facts you need are included, nothing extraneous is mentioned, the answer is fully specified, along with hints to nudge you toward a single expected canonical solution. This project is much more like the real world of messy problems where it is up to you to fully the define the end point, or a series of ever more difficult versions of this project and research the information yourself to solve them.

Everything I have to say to help you with this project is written below. I am not prepared to help you implement it; or give you any additional materials. I have too many other projects of my own.

Though I am a programmer by profession, 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 in any way you please and to keep all the profits from your endeavour.

Please do not email me about this project without reading the disclaimer above.

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.

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number