***************************************************************************
*   Please make sure that you have done the following before proceeding   *
*   with the CDF-JSON (CDFJson) utilities:                       * 
*                                                                         *
*     - Installed JDK 1.8 or later.                                       *
*     - installed/built the CDF distribution package.                     *
***************************************************************************

Instructions for using the CDF's JSON programs
----------------------------------------------

1. Set the CLASSPATH and LD_LIBRARY_PATH (DYLD_LIBRARY_PATH for Mac OSX)
   environment variables. [On Windows, run setenv.bat located in the top
   distribution to the setup, if not already done when the package
   was installed.]

   1) CLASSPATH should point to the following information:
      - the location (full path name) of the cdfjson.jar file that was
        extracted in step 1.
      - the location (full path name) of the cdfjava.jar file.

      Examples:

      - using Oracle's Java

         setenv CLASSPATH ${CLASSPATH}:.: \
                      /home/cdf/cdf39_1-dist/cdfjava/classes/cdfjava.jar: \
                      /home/cdf/cdf39_1-dist/cdfjava/cdfml/cdfjson.jar

      Note:
         Absolute/full path name (not relative path) MUST be used when adding
         the location of a program to the CLASSPATH environment variable.


   2) LD_LIBRARY_PATH should point to the following information:
      - the location (full path name) of the CDF-Java JNI
        libcdfNativeLibrary.[so|sl|jnilib] (it should be under cdfjava/lib
        from the distribution)

      - the location (full path name) of the CDF shared library that is
        defined by the environment variable CDF_LIB.  This variable is
        defined when the CDF library is installed.

      Example:
         setenv LD_LIBRARY_PATH .:/home/cdf/cdf39_1-dist/cdfjava/lib:${CDF_LIB}

         OR for Mac OSX,
         setenv DYLD_LIBRARY_PATH .:/home/cdf/cdf39_1-dist/cdfjava/lib:${CDF_LIB}


3. Use CDF2Json Java program to create a JSON file from a CDF file.
   To get the instructions and valid arguments/options, enter:

       java CDF2Json

4. Use Json2CDF Java program to convert a JSON file to a CDF file. To 
   get the instructions and valid arguments/options, enter:

       java Json2CDF

5. Use CDFJsonReader tool to view the JSON file in a easy-to-read text form.

   Run: java CDFJsonReader test.json 


Note: 
   If one creates a JSON file from an existing CDF file and creates a new
   CDF file from that JSON file, the contents of the new file will be the same 
   as the original CDF file, if the data formats for metadata are included in
   the JSON file.  But the ordering of some of the variable 
   attributes in the new file could be different from the original file 
   that should be transparent to the users.
 
   Please direct any comments or questions to:
   nasa-cdf-support@nasa.onmicrosoft.com
 
