I am trying to import hdf.hdf5lib.H5 into my maven project in NetBeans. It has this as an import string
import hdf.hdf5lib.H5;
as suggested here: https://support.hdfgroup.org/products/java/JNI3/jhi5/index.html
However, this excludes this exception:
java.lang.ExceptionInInitializerError Caused by: java.lang.RuntimeException: Uncompilable source code - package hdf.hdf5lib does not exist
NetBeans already warned me about this by saying "packadge does not excist" in the import line. So I allowed "look for dependencies in Maven repositories." He finds something, and he adds this to my pom.xml:
<dependency> <groupId>org.hdfgroup</groupId> <artifactId>hdf-java</artifactId> <version>2.6.1</version> <type>jar</type> </dependency>
Unfortunately, it saves a warning in the import line "packadge is not excist" and an error exception. This addition to pom.xml seems to do nothing.
I'm new to all of this, so maybe the solution is obvious, but I can't find it. These questions are already dated between 2012 and 2014, but did not help me:
http://hdf-forum.184993.n3.nabble.com/maven-repository-for-java-release-td4026938.html
http://hdf-forum.184993.n3.nabble.com/HDF-Java-on-Maven-td4025772.html
add hdf5 libs (java and C ++) to the maven public repository?
As suggested by ddarellis, this may be a version issue. There seem to be two options.
- HDF Java 3.3.2 and HDF5-1.8.19 (HDFView version 2.14)
- Java HDF Object Package 3.0.0 and HDF5-1.10
I will try both, but the maven suggestion to use Java 2.6.1 HDF is incorrect.
This post was useful for adding jarhdf5-3.3.2.jar depending.
https://forums.netbeans.org/post-62903.html#62903
- In the Maven project, open the Add Dependency dialog
- Compose some groupId, artifactId and version and fill them out, OK.
- The dependency will be added to pom.xml and will appear in the "Libraries" section of the maven project node
- Right-click Lib node and "manually install the artifact", fill in the path to the bank. The jar must be installed on the local Maven repository with the coordinates entered in step 2).
So, I installed HDF5 1.8.19 HDFView2.14 and added jarhdf5-3.3.2 to the dependencies. However, I get this error when I try to run:
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at hdf.hdf5lib.H5.<clinit>(H5.java:230)