summaryrefslogtreecommitdiffstats
path: root/java/examples/intro
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2021-05-06 21:07:08 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2021-05-06 21:07:08 (GMT)
commitf2cb86499efa2fe6f44ca2f4e93ea62e952d0fb0 (patch)
tree8c26de9faca9450513bf771d36ded0593b66419a /java/examples/intro
parent457b199a383865febbd52045b343b902ef383512 (diff)
downloadhdf5-f2cb86499efa2fe6f44ca2f4e93ea62e952d0fb0.zip
hdf5-f2cb86499efa2fe6f44ca2f4e93ea62e952d0fb0.tar.gz
hdf5-f2cb86499efa2fe6f44ca2f4e93ea62e952d0fb0.tar.bz2
Brings java wrapper updates from develop
The wrappers compile but fail tests due to some missing develop functionality
Diffstat (limited to 'java/examples/intro')
-rw-r--r--java/examples/intro/H5_CreateAttribute.java9
-rw-r--r--java/examples/intro/H5_CreateDataset.java7
-rw-r--r--java/examples/intro/H5_CreateFile.java3
-rw-r--r--java/examples/intro/H5_CreateGroup.java5
-rw-r--r--java/examples/intro/H5_CreateGroupAbsoluteRelative.java9
-rw-r--r--java/examples/intro/H5_CreateGroupDataset.java17
-rw-r--r--java/examples/intro/H5_ReadWrite.java7
-rw-r--r--java/examples/intro/JavaIntroExample.sh.in11
8 files changed, 34 insertions, 34 deletions
diff --git a/java/examples/intro/H5_CreateAttribute.java b/java/examples/intro/H5_CreateAttribute.java
index 22b03ad..949a770 100644
--- a/java/examples/intro/H5_CreateAttribute.java
+++ b/java/examples/intro/H5_CreateAttribute.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -28,10 +27,10 @@ public class H5_CreateAttribute {
private static String DATASETATTRIBUTE = "Units";
private static void CreateDatasetAttribute() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims1 = { DIM_X, DIM_Y };
long[] dims = { 2 };
int[] attr_data = { 100, 200 };
diff --git a/java/examples/intro/H5_CreateDataset.java b/java/examples/intro/H5_CreateDataset.java
index 7b56e83..f938be2 100644
--- a/java/examples/intro/H5_CreateDataset.java
+++ b/java/examples/intro/H5_CreateDataset.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -27,9 +26,9 @@ public class H5_CreateDataset {
private static final int DIM_Y = 6;
private static void CreateDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
// Create a new file using default properties.
diff --git a/java/examples/intro/H5_CreateFile.java b/java/examples/intro/H5_CreateFile.java
index 367e61f..d48ba6c 100644
--- a/java/examples/intro/H5_CreateFile.java
+++ b/java/examples/intro/H5_CreateFile.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -24,7 +23,7 @@ public class H5_CreateFile {
static final String FILENAME = "H5_CreateFile.h5";
private static void CreateFile() {
- long file_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
// Create a new file using default properties.
try {
diff --git a/java/examples/intro/H5_CreateGroup.java b/java/examples/intro/H5_CreateGroup.java
index 54f6252..c0bb954 100644
--- a/java/examples/intro/H5_CreateGroup.java
+++ b/java/examples/intro/H5_CreateGroup.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -25,8 +24,8 @@ public class H5_CreateGroup {
private static String GROUPNAME = "MyGroup";
private static void CreateGroup() {
- long file_id = -1;
- long group_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long group_id = HDF5Constants.H5I_INVALID_HID;
// Create a new file using default properties.
try {
diff --git a/java/examples/intro/H5_CreateGroupAbsoluteRelative.java b/java/examples/intro/H5_CreateGroupAbsoluteRelative.java
index b9c35d7..f2c6168 100644
--- a/java/examples/intro/H5_CreateGroupAbsoluteRelative.java
+++ b/java/examples/intro/H5_CreateGroupAbsoluteRelative.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -27,10 +26,10 @@ public class H5_CreateGroupAbsoluteRelative {
private static String GROUPNAME_B = "GroupB";
private static void CreateGroupAbsoluteAndRelative() {
- long file_id = -1;
- long group1_id = -1;
- long group2_id = -1;
- long group3_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long group1_id = HDF5Constants.H5I_INVALID_HID;
+ long group2_id = HDF5Constants.H5I_INVALID_HID;
+ long group3_id = HDF5Constants.H5I_INVALID_HID;
// Create a new file using default properties.
try {
diff --git a/java/examples/intro/H5_CreateGroupDataset.java b/java/examples/intro/H5_CreateGroupDataset.java
index 191a21a..f1d1cba 100644
--- a/java/examples/intro/H5_CreateGroupDataset.java
+++ b/java/examples/intro/H5_CreateGroupDataset.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -32,12 +31,12 @@ public class H5_CreateGroupDataset {
private static final int DIM2_Y = 10;
private static void h5_crtgrpd() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long group_id = -1;
- long group1_id = -1;
- long group2_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long group_id = HDF5Constants.H5I_INVALID_HID;
+ long group1_id = HDF5Constants.H5I_INVALID_HID;
+ long group2_id = HDF5Constants.H5I_INVALID_HID;
int[][] dset1_data = new int[DIM1_X][DIM1_Y];
int[][] dset2_data = new int[DIM2_X][DIM2_Y];
long[] dims1 = { DIM1_X, DIM1_Y };
@@ -108,7 +107,7 @@ public class H5_CreateGroupDataset {
try {
if (dataspace_id >= 0)
H5.H5Sclose(dataspace_id);
- dataspace_id = -1;
+ dataspace_id = HDF5Constants.H5I_INVALID_HID;
}
catch (Exception e) {
e.printStackTrace();
@@ -118,7 +117,7 @@ public class H5_CreateGroupDataset {
try {
if (dataset_id >= 0)
H5.H5Dclose(dataset_id);
- dataset_id = -1;
+ dataset_id = HDF5Constants.H5I_INVALID_HID;
}
catch (Exception e) {
e.printStackTrace();
diff --git a/java/examples/intro/H5_ReadWrite.java b/java/examples/intro/H5_ReadWrite.java
index 812ac77..67e1ac5 100644
--- a/java/examples/intro/H5_ReadWrite.java
+++ b/java/examples/intro/H5_ReadWrite.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -27,9 +26,9 @@ public class H5_ReadWrite {
private static final int DIM_Y = 6;
private static void ReadWriteDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
diff --git a/java/examples/intro/JavaIntroExample.sh.in b/java/examples/intro/JavaIntroExample.sh.in
index 4eac31d..db741e5 100644
--- a/java/examples/intro/JavaIntroExample.sh.in
+++ b/java/examples/intro/JavaIntroExample.sh.in
@@ -1,7 +1,6 @@
#! /bin/sh
#
# Copyright by The HDF Group.
-# Copyright by the Board of Trustees of the University of Illinois.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
@@ -15,6 +14,7 @@
top_builddir=@top_builddir@
top_srcdir=@top_srcdir@
srcdir=@srcdir@
+IS_DARWIN="@H5_IS_DARWIN@"
TESTNAME=EX_Intro
EXIT_SUCCESS=0
@@ -33,8 +33,8 @@ nerrors=0
# where the libs exist
HDFLIB_HOME="$top_srcdir/java/lib"
-BLDLIBDIR="$top_builddir/hdf5/lib"
BLDDIR="."
+BLDLIBDIR="$BLDDIR/testlibs"
HDFTEST_HOME="$top_srcdir/java/examples/intro"
JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar
TESTJARFILE=jar@PACKAGE_TARNAME@intro.jar
@@ -99,6 +99,13 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
fi
done
+ if [ "$IS_DARWIN" = "yes" ]; then
+ (cd $BLDLIBDIR; \
+ install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \
+ exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \
+ echo $exist_path; \
+ install_name_tool -change $exist_path @rpath/libhdf5.dylib libhdf5_java.dylib)
+ fi
# copy jar files. Used -f to make sure get a new copy
for tstfile in $COPY_JARTESTFILES
do