How do I resolve the error "java.lang.NoClassDefFoundError" or "java.lang.ClassNotFoundException"?


These errors mean that a java class was not found by the JVM.

It can be returned at startup if the main program name has not been passed correctly in the command line (remember that Java is case-sensitive and the .class extension should be omitted) or if a typo caused Java to treat an option in the command line as if it was the program to launch.

You can also get this error when calling a class with a CALL statement. The name of the missing class is usually returned with the error message. Make sure this class is available in one of the locations specified in the CLASSPATH or the iscobol.code_prefix variable setting. It is often helpful to create a log file to see where the runtime is looking for the class.  You can do this by adding these lines to your configuration file:

iscobol.tracelevel=15
iscobol.logfile=path.and.name.to.log.file

For instance, this line found in a logfile shows that the runtime looked in the prg folder for the ISPROGRAM.class program:

TRY LOADING:prg\ISPROGRAM.class
...
CALL 'ISPROGRAM' FAILED (java.lang.NoClassDefFoundError: ISPROGRAM)
com.iscobol.rts.IscobolRuntimeException: CALL not found: ISPROGRAM (java.lang.NoClassDefFoundError: ISPROGRAM)



Article ID: 237
Created: December 2, 2014
Last Updated: January 13, 2026
Author: Support KB Author

Online URL: https://support.veryant.com/phpkb/article.php?id=237