NoSuchFieldError Java

This error is typically thrown if you only partially recompile your code. You’ve got old code that is referencing a field that no longer exists in the recompiled class files.

The solution is to clean out all the class files and compile everything from fresh.

Update: If you still get the same error after recompiling everything, then you’re probably compiling against one version of an external library and using another at runtime.

What you need to do now is first identify the class that is causing the problem (it looks like you have done this already) and then run your application with the -verbose:class command line option. It will dump a lot of class loading information on your standard out and you’ll be able to find out where the problematic class is exactly loaded from.

Leave a Comment