| 1 | |
|---|
| 2 | JNEXUS |
|---|
| 3 | |
|---|
| 4 | This is the README file for the NeXus API for Java, Version 2.0. |
|---|
| 5 | This version supports both HDF-4 and HDF-5. |
|---|
| 6 | |
|---|
| 7 | The NeXus API for Java (JAPI) is implemented by a class NexusFile |
|---|
| 8 | which calls the C-language NeXus-API through the Java Native |
|---|
| 9 | Methods Interface (JNI). For more documentation see the API |
|---|
| 10 | documentation in the directory apidoc and the class TestJapi.java |
|---|
| 11 | in directory test which not only serves as a test driver for |
|---|
| 12 | the JAPI but also as a code example for the usage of the NexusFile |
|---|
| 13 | methods. |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | ACKNOWLEGDEMENT |
|---|
| 18 | |
|---|
| 19 | This library uses a lot of code taken from the Java HDF Interface |
|---|
| 20 | libraries provided by the NCSA-HDF team. Essentially all the number |
|---|
| 21 | conversion code is taken from there. Also, the JHI served as a |
|---|
| 22 | valuable source for inspiration during the devlopment of this |
|---|
| 23 | library. Please see the file COPYING.NCSA for more details. See |
|---|
| 24 | JHI version from which the code was extracted was JHI-2.5 as |
|---|
| 25 | downloaded in October 2000. |
|---|
| 26 | |
|---|
| 27 | USAGE |
|---|
| 28 | |
|---|
| 29 | I hope you downloaded a binary distribution of the JAPI. Due to the |
|---|
| 30 | complexity of this code we strive to provide binary distributions |
|---|
| 31 | for most platforms. If yours is not supported (we cannot have |
|---|
| 32 | samples of any computer system in the world) compilation instructions |
|---|
| 33 | can be found below. |
|---|
| 34 | |
|---|
| 35 | As the JAPI uses native methods your Java runtime needs to locate the |
|---|
| 36 | shared library implementing the NAPI. Otherwise you will get an |
|---|
| 37 | Unsatisfied Link Error. There are three possibilities how the Java |
|---|
| 38 | runtime can locate the shared library: |
|---|
| 39 | - You or your system administrator puts the shared library into the |
|---|
| 40 | systems default location for shared libraries. On Windows |
|---|
| 41 | platforms this is any directory on the PATH, on a Unix system it |
|---|
| 42 | is usually something like /usr/shlib. |
|---|
| 43 | - You put it wherever you want on your unix system and set the |
|---|
| 44 | environment variable LD_LIBRARY_PATH to point to that directory. |
|---|
| 45 | More info on this in the manpages of your systems loader. |
|---|
| 46 | - You explicitly tell the Java Runtime where the shared library is |
|---|
| 47 | through the -Dorg.nexusformat.JNEXUSLIB=full-path-to-library |
|---|
| 48 | option. |
|---|
| 49 | |
|---|
| 50 | Furthermore you need to include the jnexus.jar file in your Java |
|---|
| 51 | classpath both for compiling and running Java programs using the |
|---|
| 52 | JAPI. |
|---|
| 53 | |
|---|
| 54 | As an example, see the runtestxx scripts supplied in the test |
|---|
| 55 | directory for running the test driver. |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | COMPILING |
|---|
| 60 | |
|---|
| 61 | Is fairly easy on a Unix system. Use one of the supplied Makefiles |
|---|
| 62 | (Makefile dor DigitalUnix4.0D or, Make.tux for Redhat Linux 6.2) |
|---|
| 63 | and adapt the settings of the variables in the configuration |
|---|
| 64 | section to the state of your system. You need to know: |
|---|
| 65 | - Where you Java binaries, include files, libraries reside. |
|---|
| 66 | - Where the HDF4.1r3 libraries are installed. |
|---|
| 67 | - Furthermore adapt some compiler options in order to reflect the |
|---|
| 68 | way how your compiler builds shared libraries. |
|---|
| 69 | |
|---|
| 70 | |
|---|
| 71 | AUTHOR and Target for Comments: |
|---|
| 72 | |
|---|
| 73 | Mark Koennecke |
|---|
| 74 | Laboratory for Neutron Scattering |
|---|
| 75 | Paul Scherrer Institut |
|---|
| 76 | CH-5232 Villigen-PSI |
|---|
| 77 | Switzerland |
|---|
| 78 | Mark.Koennecke@psi.ch |
|---|
| 79 | |
|---|