Building with java 11 without jpackage: ant binaryPackage does not work


#1

The build instructions indicate to
ant run
ant binaryPackage
but my Linux environment has Java 11 and it does not seem to have jpackage…

how to obtain ./build/dist then?
is there a work around?
is it something that could be done manually?


#2

https://adam-carroll.medium.com/java-packager-with-jdk11-31b3d620f4a8 describes building packages on Windows, macOS, and Linux using backport to Java 11.


#3

Yes, I saw that too when I googled the matter.

The problem is that, not only I do not know Java, but hdfview is not even my personal project, I don’t know how it is structured, what is what or what to collect, etc. In other words, I wouldn’t know what command line options and arguments to pass to jpackager.

Having said, I did download jpackager and I could use it; so, if the hdfview developers could indicate how to use jpackager instead of the “ant binaryPackage” command, that would be great.


#4

So, no takers on this one? :slightly_frowning_face:


#5

Because of the various platforms and installation requirements packaging requires a minimum of java 17.

However if you do not need to package HDFView for distribution, ant run should be sufficient to create a local instance. (just locate the log file for the run target command)


#6

Luckily, that is correct, I don’t need a formal package for distribution; that is why I am simply asking for somebody to tell what it is I could manually collect and just copy into some installation directory.

As it is, the “ant run” command did something and even launched hdfview, right after; but, when I looked at the ./build directory and look into some launch script there (/tmp/hdfview-3.2.0/build/HDF_Group/HDFView/3.2.0/hdfview.sh), I just don’t see how it could have worked…the paths referenced there do not yet exist.

The ./build directory has the following sub-directories:
HDF_Group
classes
dist
jar
javadocs

but the dist/ directory is practically empty, since the command “ant binaryPackage” did not work.

If I look into the antoutput.log file, there is some command and an attempt to run jpackage, but it errors out as it was incompatible with the jpackage that I downloaded for use with Java 11.

In summary, my request can be formulated in a couple of ways:

  • How it is the hdfview group provided a build for distribution before jpackage was available? Or,
  • What should I manually collect in the absence of jpackage ?

By the way, I am not a Java developer nor know java or ant or that stuff, I am just somebody who wants to build and use hdfview.


#7

You need to only use the log after “ant run” and not attempt package.

Here is my “run”:
run:
[mkdir] Created dir: HDF_Projects/hdfview-3_dev/build/jar/lib/ext
[java] Executing ‘/usr/lib/jvm/java-18-openjdk-18.0.1.0.10-1.rolling.fc35.x86_64/bin/java’ with arguments:
‘-Dorg.slf4j.simpleLogger.defaultLogLevel=trace’
‘-Dgwt.dummy.arg1=’
‘-Djava.library.path=HDF_Projects/temp/HDF_Group/HDF/4.2.15/lib:HDF_Projects/temp/HDF_Group/HDF5/1.10.10/lib’
‘-Dhdfview.root=HDF_Projects/hdfview-3_dev/build/jar’
‘-classpath’
‘HDF_Projects/hdfview-3_dev/lib/fits.jar:HDF_Projects/hdfview-3_dev/lib/netcdf.jar:HDF_Projects/temp/HDF_Group/HDF/4.2.15/lib/jarhdf-4.2.15.jar:
HDF_Projects/temp/HDF_Group/HDF5/1.10.10/lib/jarhdf5-1.10.10.jar:HDF_Projects/hdfview-3_dev/lib/ext/swt/linux/x86_64/swt.jar:
HDF_Projects/hdfview-3_dev/lib/ext/swt/common-image-3.3.2.jar:HDF_Projects/hdfview-3_dev/lib/ext/swt/common-io-3.3.2.jar:
HDF_Projects/hdfview-3_dev/lib/ext/swt/common-lang-3.3.2.jar:HDF_Projects/hdfview-3_dev/lib/ext/swt/commons-logging-1.2.jar:
HDF_Projects/hdfview-3_dev/lib/ext/swt/imageio-core-3.3.2.jar:HDF_Projects/hdfview-3_dev/lib/ext/swt/imageio-metadata-3.3.2.jar:
HDF_Projects/hdfview-3_dev/lib/ext/swt/imageio-tiff-3.3.2.jar:HDF_Projects/hdfview-3_dev/lib/ext/swt/org.eclipse.collections.jar:
HDF_Projects/hdfview-3_dev/lib/ext/swt/org.eclipse.core.commands.jar:HDF_Projects/hdfview-3_dev/lib/ext/swt/org.eclipse.equinox.common.jar:
HDF_Projects/hdfview-3_dev/lib/ext/swt/org.eclipse.jface.jar:HDF_Projects/hdfview-3_dev/lib/ext/swt/org.eclipse.nebula.widgets.nattable.core.jar:
HDF_Projects/hdfview-3_dev/lib/ext/swt/org.eclipse.osgi.jar:HDF_Projects/hdfview-3_dev/lib/ext/swt/org.eclipse.ui.workbench.jar:
HDF_Projects/hdfview-3_dev/lib/slf4j-api-1.7.33.jar:HDF_Projects/hdfview-3_dev/lib/extra/slf4j-simple-1.7.33.jar:
HDF_Projects/hdfview-3_dev/lib/ext/swt/swtbot/org.apache.log4j.jar:HDF_Projects/hdfview-3_dev/lib/ext/swt/swtbot/org.eclipse.swtbot.jar:
HDF_Projects/hdfview-3_dev/lib/ext/swt/swtbot/org.eclipse.swtbot.junit4_x.jar:
HDF_Projects/hdfview-3_dev/lib/ext/swt/swtbot/org.eclipse.swtbot.nebula.gallery.finder.jar:
HDF_Projects/hdfview-3_dev/lib/ext/swt/swtbot/org.eclipse.swtbot.nebula.nattable.finder.jar:
HDF_Projects/hdfview-3_dev/lib/ext/swt/swtbot/org.eclipse.swtbot.swt.finder.jar:HDF_Projects/hdfview-3_dev/build/jar/hdfobject.jar:
HDF_Projects/hdfview-3_dev/build/jar/HDFView.jar’
‘hdf.view.HDFView’


#8

Aaahh, ok.

Alright, I did just that; pulled the run command from antoutput.log and placed it into a launch script:

#!/bin/bash
/usr/lib/jvm/java-11-openjdk-11.0.15.0.9-2.el7_9.x86_64/bin/java \
-Dorg.slf4j.simpleLogger.defaultLogLevel=trace \
-Dgwt.dummy.arg1= \
-Djava.library.path=/usw/spgtools/hdf/4.2.15/centos7/lib:/usw/spgtools/hdf5/1.12.2/centos7/lib \
-Dhdfview.root=/tmp/hdfview-3.2.0/build/jar \
-classpath \
/tmp/hdfview-3.2.0/lib/fits.jar:\
/tmp/hdfview-3.2.0/lib/netcdf.jar:\
/usw/spgtools/hdf/4.2.15/centos7/lib/jarhdf-4.2.15.jar:\
/usw/spgtools/hdf5/1.12.2/centos7/lib/jarhdf5-1.12.2.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/linux/x86_64/swt.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/common-image-3.3.2.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/common-io-3.3.2.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/common-lang-3.3.2.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/commons-logging-1.2.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/imageio-core-3.3.2.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/imageio-metadata-3.3.2.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/imageio-tiff-3.3.2.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/org.eclipse.collections.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/org.eclipse.core.commands.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/org.eclipse.equinox.common.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/org.eclipse.jface.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/org.eclipse.nebula.widgets.nattable.core.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/org.eclipse.osgi.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/org.eclipse.ui.workbench.jar:\
/tmp/hdfview-3.2.0/lib/slf4j-api-1.7.33.jar:\
/tmp/hdfview-3.2.0/lib/extra/slf4j-simple-1.7.33.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/swtbot/org.apache.log4j.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/swtbot/org.eclipse.swtbot.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/swtbot/org.eclipse.swtbot.junit4_x.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/swtbot/org.eclipse.swtbot.nebula.gallery.finder.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/swtbot/org.eclipse.swtbot.nebula.nattable.finder.jar:\
/tmp/hdfview-3.2.0/lib/ext/swt/swtbot/org.eclipse.swtbot.swt.finder.jar:\
/tmp/hdfview-3.2.0/build/jar/hdfobject.jar:\
/tmp/hdfview-3.2.0/build/jar/HDFView.jar  \
hdf.view.HDFView

It actually works :smiley:

I guess I can now start collecting only that and placing it in an installation directory. Let’s see if something happens to break as I move stuff over and something implicit read is left behind. We shall see.

Thanks.