This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Tennessee James Leeuwenburg wrote:
Hi all, To get around a problem I've been having, I created some copies of the dods.servers.netcdf.* classes in a subpackage of my own. When I try to create a new NetcdfFile (ucar.nc2.NetcdfFile), I get a NoClassDefFoundError :: java.lang.NoClassDefFoundError: ucar/netcdf/AbstractNetcdf This seems to be in the "version 1" libraries. The page http://www.unidata.ucar.edu/packages/netcdf-java/ assures me that while some code is reused, they are separate libraries. I'm going to try downloading the version one stuff to my development area, assuming that there's in fact a dependency on the existence of version one by version two. However, it's a confusing thing to read. Cheers, -T
Hi Tennessee: I just checked, and ucar.netcdf.AbstractNetcdf is present in: ftp://ftp.unidata.ucar.edu/pub/netcdf-java/v2.1/netcdf.jarso you are either using a different jar, or your classpath is wrong somehow. I would resolve that rather than downloading the old version 1 jar.
Let me know what you find, john