NetCDF Java Library
The NetCDF-Java Library is a Java interface to NetCDF
files, as well as to many other types of scientific data formats.
The library is freely available and the source code is released under the (MIT-style) netCDF C library license. Previous versions use the GNU
Lesser General Public License
The preferred place to ask questions, discuss problems and features and get
support is in the NetCDF-Java
email list, which you can subscribe to from this
page. Also you might want to search
or browse previous netCDF-Java support questions.
The NetCDF-Java library implements a Common Data Model (CDM), a generalization of the NetCDF, OpenDAP and HDF5 data models. The library is a prototype for the NetCDF-4 project, which provides a C language API for the "data access layer" of the CDM, on top of the HDF5 file format. The NetCDF-Java library is a 100% Java framework for reading netCDF and other file formats into the CDM, as well as writing to the netCDF-3 file format. The NetCDF-Java library also implements NcML, which allows you to add metadata to CDM datasets, as well as to create virtual datasets through aggregation.
Which jar files do I need? See Jar Dependencies for explanation of which library you want.
Current Stable release version 4.3 (requires Java 6)
CDM/TDS source is now hosted on GitHub, and the source jar is no longer available, and ant builds are no longer supported. To build version 4.3 from source with maven:
git clone git://github.com/Unidata/thredds.git thredds
If you want to do careful JAR inclusion, see Jar Dependencies for explanation of which jars you need. Most needs can be fulfilled using the complete CDM or ToolsUI JARs:
- The complete netCDF library jar implements the full CDM model, with all dependent jars included.
- The toolsUI.jar also includes UI classes, and allows you to run the netCDF ToolsUI application directly from it with "java -Xmx1g -jar toolsUI.jar"
- The ncIDV.jar is for the IDV netcdf 4.3 branch.
- Public javadoc. This is the public interface. Future changes to the API will attempt to remain backwards compatible with this API.
- All javadoc. This is the javadoc for all packages and all methods except private. CAREFUL, much of this will change.
- Try out the 4.3 version of ToolsUI application: launch from webstart.
- Unidata public Maven repository for version 4.3 artifacts
- All source is on GitHub
File format types
The NetCDF-Java library can read these file types and remote access protocols.
Note to GRIB users:
If you are depending on the CDM/TDS to read GRIB files, you must upgrade to 4.3 AND closely examine the output of any files that you really care about. Check parameter names and everything else against the original documentation if possible, especially if there is any local parameter use. Please send us any files you suspect might be incorrectly read by the CDM library. Note that we will not backport fixes to version 4.2. Note that the variable names in 4.3 will be different from those in 4.2.
Evolving documentation for GRIB is at:
Caveats and not-so-stable APIs:
- Writing to netCDF-3 format is supported, but new features in the CDM, e.g. groups, structures, long data types are not yet supported.
- Writing to netCDF-4 format is supported, if you have the netCDF C library loaded. As of 4.3.14, this is BETA software.
- The catalog API will be redone, however the current API will remain supported.
You may need to first download the free WebEx Player.
Working notes and documentation on the coordinate system layer of the CDM
Working notes and documents on the scientific feature type layer of the CDM
Streaming NetCDF (Experimental)
Software libraries used by the Netcdf-Java library:
- Apache Commons HttpClient for HTTP access
- Java-OPeNDAP library for reading OPeNDAP. (note this is branched from the opendap.org site)
- JDOM for parsing XML.
- JGoodies for UI stuff
- JPEG2000 library for decoding GRIB2 files.
- Simple Logging Facade for Java (SLF4J) for logging
- Spring lightweight application framework. Used in ToolsUI application.
- VisAD for reading McIDAS AREA files.
Applications using the Netcdf-Java library (partial list):
Older versions (not supported)
Previous stable release version 4.2 (requires Java 6)
See Jar Dependencies for explanation of which library you want:
- Public javadoc, downloadable jar file. This is the public interface. Future changes to the API will remain backwards compatible with this API.
- All javadoc, downloadable jar file. This is the javadoc for all packages and all methods except private. CAREFUL, some of this may change.
Building from source with maven
The currently supported way to build version 4.2 from source with maven:
svn co http://svn.unidata.ucar.edu/repos/thredds/branch/RB-TDS-4.2/ thredds
You can also get the 4.2.28 build at http://maven.geotoolkit.org/edu/ucar/netcdf/
Last version for Java 5 (4.0.49)
Last version for Java 4.2 (2.2.20)
- Public javadoc: This is the public interface.
- All javadoc: Javadoc for all packages and all methods except private. CAREFUL, some of this may change.
- User's documentation (incomplete): doc pdf
This document is maintained by John Caron
and was last updated April 2013