Source Files
After you download and extract the source package, you will have the HDF Java native C code and the Java source code for JNI, HDF-Object package and HDFView. You need to compile the C source and Java source separately. The following instructions tell you how to build the C source in Visual C++ and the Java source from batch file.
| Source directory | Description |
|---|---|
| hdf-java/native/hdflib/ | C header files and C source files for HDF4 Java Native Interface |
| hdf-java/native/hdf5lib/ | C header files and C source files for HDF5 Java Native Interface |
| hdf-java/ncsa/hdf/hdflib/ | Java source files for HDF4 Java Native Interface |
| hdf-java/ncsa/hdf/hdf5lib/ | Java source files for HDF5 Java Native Interface |
| hdf-java/ncsa/hdf/object/ | Java source files for HDF-Object package |
| hdf-java/ncsa/hdf/view/ | Java source files for HDFView |
Requirements
You need the following libraries in order to compile the HDF Java products.- The Pre-Compiled HDF4 Binaries: obtain from /release4/obtain.html
- The Pre-Compiled HDF5 Binaries: obtain from /HDF5/release/obtain5.html
- JPEG Library: obtain from http://www.hdfgroup.org/ftp/lib-external/jpeg/
- GZIP Library: obtain from http://www.hdfgroup.org/ftp/lib-external/zlib/
- SZIP Library: obtain from http://www.hdfgroup.org/ftp/lib-external/szip/
- JDK 1.5.0 or above
Compile the HDF Java Native C
To compile the HDF Java Native C code, you need to have Microsoft Visual Studio 2008 installed on your machine. Under the windows\proj\all folder is the solution file.- jhdf.vcproj
- Project to compile HDF4 Java Native C, native/hdflib/*.c files
Winsock functions, Ws2_32.lib, must be included, i.e. LINK32_FLAGS=... ws2_32.lib ... - jhdf5.vcproj
- Project to compile HDF5 Java Native C, native/hdf5lib/*.c files
Compile the HDF native Source Code
To compile the HDF native Source Code, you run the jnibuild.bat batch file within the hdf-java root folder. You must pass the compiler version (currently only VS9) as a parameter.- jnibuild.bat
- Batch to compile HDF native source
Compile the HDF Java Source Code
To compile the HDF Java Source Code, you need to have jdk1.5.0 or above installed on your machine. You run the javabuild.bat batch file within the hdf-java root folder. You must pass the hdf-java source folder (C:\hdf-java) as a parameter.- javabuild.bat
- Batch to compile HDF Java source
Test the HDF Java Build
To test the HDF Java Build, you need to have jdk1.5.0 or above installed on your machine. You run the javacheck.bat batch file within the hdf-java root folder. You must pass the hdf-java source folder (C:\hdf-java) as a parameter.- javacheck.bat
- Batch to test HDF Java
Install the HDF Java Build
To install the HDF Java Build, you need to have jdk1.5.0 or above installed on your machine. You run the javainstall.bat batch file within the hdf-java root folder. You must pass the destination folder (C:\programs\hdf-java) as a parameter.- javainstall.bat
- Batch to install HDF Java
Running the HDF Java code
After successfully run the batch files, the binaries of the HDF Java products are packed and put at destination folder.
| Binary file | Description | |
|---|---|---|
| lib/jhdf.jar | The Java HDF Interface, accesses the native HDF4 library | |
| lib/jhdf5.jar | The Java HDF5 Interface, accesses the native HDF5 library | |
| lib/jhdfobj.jar | The common HDF object package, ncsa.hdf.object | |
| lib/jhdf4obj.jar | The HDF4 object package, ncsa.hdf.object.h4 | |
| lib/jhdf5obj.jar | The HDF5 object package, ncsa.hdf.object.h5 | |
| lib/jhdfview.jar | The ncsa.hdf.view package, for HDFView only. | |
| lib/win/ | ||
| jhdf.dll | The native HDF4 library and JNI implementation (called by jhdf.jar) | |
| jhdf5.dll | The native HDF5 library and JNI implementation (called by jhdf5.jar) | |
Using nt_makefile
You may also use native/hdf5lib/nt_makfile and native/hdflib/nt_makefile to build HDF5 JNI and HDF4 JNI respectively. To comiple the source code, run 'nmake -f nt_makefile' You have to add your VS studio bin path to your system path, e.g.set path=%path";"C:\Program Files\Microsoft Visual Studio 8\VC\bin" We do not provide any support for nt_makefile. If you encounter any problems for using nt_makefile, you should be able to find solutions online.
- - Last modified:May 23rd 2011
