Building hdf-java from source


#1

Hi, I'm trying to build hdf-java following instructions at:
https://support.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfview-3.0.0/src/unpacked/docs/Build_HDFView.txt

from clone of https://bitbucket.hdfgroup.org/scm/hdfview/hdfview.git.

Maybe it is a java or ant versioning problem? Class path problem? Get the following build results:

···

---------------------------

Buildfile: /home/roger/Software/hdfview/build.xml
[taskdef] Could not load definitions from resource net/sf/antcontrib/antlib.xml. It could not be found.
[loadresource] Do not set property hdfjava.version as its length is 0.
[echo]
[echo] Application: HDFView 99.99
[echo] Build File: /home/roger/Software/hdfview/build.xml
[echo]
[echo] Run by: roger
[echo] Build Dir: build
[echo] Base Dir: /home/roger/Software/hdfview
[echo] Dist Dir: build/dist
[echo] Java Home: /home/roger/jdk-9.0.1
[echo] Classpath: /home/roger/Software/hdfview/lib/fits.jar:/home/roger/Software/hdfview/lib/netcdf.jar:/home/roger/Software/hdfview/lib/ext/swt/linux/x64/swt.jar:/home/roger/Software/hdfview/lib/ext/swt/commons-logging.jar:/home/roger/Software/hdfview/lib/ext/swt/org.eclipse.core.commands.jar:/home/roger/Software/hdfview/lib/ext/swt/org.eclipse.equinox.common.jar:/home/roger/Software/hdfview/lib/ext/swt/org.eclipse.jface.jar:/home/roger/Software/hdfview/lib/ext/swt/org.eclipse.nebula.widgets.nattable.core.jar:/home/roger/Software/hdfview/lib/slf4j-api-1.7.5.jar
[echo] HDF libpath: /home/roger/NetBeansProjects/hdf4/hdf4/lib,/home/roger/NetBeansProjects/hdf5/lib
[echo] HDF-Java version: ${hdfjava.version}
[echo] HDF4 version: 4.2.13
[echo] HDF5 version: 1.10.1
[echo] Operating System: Linux 3.10.0-693.11.1.el7.x86_64 amd64
[echo]

compile:
[javac] Compiling 1 source file to /home/roger/Software/hdfview/build/classes
[javac] Compiling 62 source files to /home/roger/Software/hdfview/build/classes
[javac] /home/roger/Software/hdfview/src/hdf/object/h4/H4Datatype.java:19: error: package hdf.hdflib does not exist
[javac] import hdf.hdflib.HDFConstants;
[javac] ^
[javac] /home/roger/Software/hdfview/src/hdf/object/h4/H4File.java:25: error: package hdf.hdflib does not exist
[javac] import hdf.hdflib.HDFConstants;
[javac] ^
[javac] /home/roger/Software/hdfview/src/hdf/object/h4/H4File.java:26: error: package hdf.hdflib does not exist

----------------------------

and many more similar errors


#2

HDF 4 and hdf5 must be built with Java enabled, does the HDF jar exist? Note, that it cannot be the jars/libs from the hdfjava 3.3 product.

Allen

···

On Thursday, January 11, 2018 10:27:06 AM CST Roger Martin wrote:

Hi, I'm trying to build hdf-java following instructions at:
https://support.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfview-3.0.0/src/unpacked/docs/Build_HDFView.txt

from clone of https://bitbucket.hdfgroup.org/scm/hdfview/hdfview.git.

Maybe it is a java or ant versioning problem? Class path problem? Get
the following build results:

---------------------------

Buildfile: /home/roger/Software/hdfview/build.xml
   [taskdef] Could not load definitions from resource
net/sf/antcontrib/antlib.xml. It could not be found.
[loadresource] Do not set property hdfjava.version as its length is 0.
      [echo]
      [echo] Application: HDFView 99.99
      [echo] Build File: /home/roger/Software/hdfview/build.xml
      [echo]
      [echo] Run by: roger
      [echo] Build Dir: build
      [echo] Base Dir: /home/roger/Software/hdfview
      [echo] Dist Dir: build/dist
      [echo] Java Home: /home/roger/jdk-9.0.1
      [echo] Classpath:
/home/roger/Software/hdfview/lib/fits.jar:/home/roger/Software/hdfview/lib/netcdf.jar:/home/roger/Software/hdfview/lib/ext/swt/linux/x64/swt.jar:/home/roger/Software/hdfview/lib/ext/swt/commons-logging.jar:/home/roger/Software/hdfview/lib/ext/swt/org.eclipse.core.commands.jar:/home/roger/Software/hdfview/lib/ext/swt/org.eclipse.equinox.common.jar:/home/roger/Software/hdfview/lib/ext/swt/org.eclipse.jface.jar:/home/roger/Software/hdfview/lib/ext/swt/org.eclipse.nebula.widgets.nattable.core.jar:/home/roger/Software/hdfview/lib/slf4j-api-1.7.5.jar
      [echo] HDF libpath:
/home/roger/NetBeansProjects/hdf4/hdf4/lib,/home/roger/NetBeansProjects/hdf5/lib
      [echo] HDF-Java version: ${hdfjava.version}
      [echo] HDF4 version: 4.2.13
      [echo] HDF5 version: 1.10.1
      [echo] Operating System: Linux 3.10.0-693.11.1.el7.x86_64 amd64
      [echo]

compile:
     [javac] Compiling 1 source file to
/home/roger/Software/hdfview/build/classes
     [javac] Compiling 62 source files to
/home/roger/Software/hdfview/build/classes
     [javac]
/home/roger/Software/hdfview/src/hdf/object/h4/H4Datatype.java:19:
error: package hdf.hdflib does not exist
     [javac] import hdf.hdflib.HDFConstants;
     [javac] ^
     [javac]
/home/roger/Software/hdfview/src/hdf/object/h4/H4File.java:25: error:
package hdf.hdflib does not exist
     [javac] import hdf.hdflib.HDFConstants;
     [javac] ^
     [javac]
/home/roger/Software/hdfview/src/hdf/object/h4/H4File.java:26: error:
package hdf.hdflib does not exist

----------------------------

and many more similar errors

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5


#3

Ah, I missed that!� Added --enable-java to both and it all built.� Thank you

···

On 01/11/2018 12:31 PM, Allen Byrne wrote:

HDF 4 and hdf5 must be built with Java enabled, does the HDF jar exist? Note, that it cannot be the jars/libs from the hdfjava 3.3 product.

Allen


#4

I’m having a similar issue - when you say they need to be built with Java enabled, what do you mean?


#5

HDFView 3.x will use the java libs/jars from the HDF4 and HDF5 releases. Those libs/jars are only available if you enable java when building hdf4 and hdf5.

Of course the other option is to use pre-built binaries.

Allen