Login  Register

Re: java.lang.UnsatisfiedLinkError in an app packaged with jpackager

Posted by eazycncn on Dec 14, 2019; 4:52pm
URL: https://forum.jogamp.org/java-lang-UnsatisfiedLinkError-in-an-app-packaged-with-jpackager-tp4040180p4040182.html



> On 14 Dec 2019, at 18.38, Sven Gothel [via jogamp] <[hidden email]> wrote:
>
> Which JogAmp modules and _version_ are you using?

How can I tell? IIRC these were grabbed from WadeWalker/github in the spring.


> (Assuming you use the latest tip of the master branches)

Ok, so that could be a problem, need to check the latest .

>
> Show us the jpackager recipe.

Here are the relevant parts of my ant build script, the jpackage call at end:

        <target name="init_windows" if="is_windows">
                <property name="jdk-loc" value="C:\Program Files\Java\jdk-11.0.2" />
                <property name="native-bundle" value="exe" />
                <property name="create-what" value="create-installer" />
                <property name="native-bundle" value="exe" />
                <property name="jpackage" value="C:/Program Files/java/jdk-13/bin/jpackage" />
                <property name="jlink" value="C:/Program Files/java/jdk-11.0.2/bin/jlink" />
                <property name="jdraft-java-runtime" value="jdraft-java-runtime/windows" />
                <property name="targetos" value="windows" />
                <property name="pathsep" value=";" />
                <property name="resource-dir" value="package-resources/windows" />
        </target>
...

                <path id="libraries">
                        <fileset dir="${lib-dir}">
                                <include name="commons-lang3-3.2.1.jar" />
                                <include name="jna-4.0.0.jar" />
                                <include name="jna-platform-4.0.0.jar" />
                                <include name="libusb-1.0.0.dylib" />
                                <include name="miglayout-3.7.jar" />
                                <include name="purejavacomm-1.0.1.x.jar" />
                                <include name="purejavahidapi.jar" />
                                <include name="tools-jdk1.8.0-u25.jar" />
                                <include name="vecmath.jar" />
                        </fileset>
                        <fileset dir="${lib-dir}/jogljars11/">
                                <include name="gluegen.jar" />
                                <include name="jogl-all.jar" />
                                <include name="jocl.jar" />
                        </fileset>

                </path>
...
                <!-- first generate a list of libraries (jars) as a ':' seprated list -->
                <fileset id="eazycnc-libs-fileset" dir="lib" includes="**" />
                <property name="prop.dist.contents" refid="eazycnc-libs-fileset" />
                <pathconvert targetos="unix" pathsep="${pathsep}" property="eazycnc-libs-list" refid="eazycnc-libs-fileset">
                        <mapper>
                                <globmapper from="${basedir}/*" to="*" handledirsep="true" />
                        </mapper>
                </pathconvert>
                <echo>${eazycnc-libs-list}</echo>
       
                <!-- use jpackage (from jdk13!!) to package the app -->
                        <exec executable="${jpackage}" dir=".">
                                <!-- <arg value="create-installer" />
                                <arg value="dmg" /> -->
                                <arg value="${create-what}" />
                                <arg value="--force" />
                                <arg value="--verbose" />
                                <arg value="--add-modules" />
                                <arg value="java.base,java.desktop" />
                                <arg value="--input" />
                                <arg value="." />
                                <arg value="--output" />
                                <arg value="bundles/" />
                                <arg value="--name" />
                                <arg value="EazyCNC" />
                                <arg value="--main-jar" />
                                <arg value="build/EazyCNC.jar" />
                                <arg value="--jvm-args" />
                                <arg value="-Xmx1024m -XX:+UseG1GC -XX:MaxGCPauseMillis=50 -XX:+PrintGC" />
                                <arg value="--resource-dir" />
                                <arg value="${resource-dir}" />
                                <arg value="--files" />
                                <arg value="build/EazyCNC.jar${pathsep}${eazycnc-libs-list}" />
                                <arg value="--runtime-image" />
                                <arg value="eazycnc-java-runtime" />
                        </exec>


        </target>

        <!--====================================================================== -->

        <target name="clean" description="clean up" depends="init">
                <delete dir="${build-dir}" failonerror="false" />
                <delete dir="${classes-dir}" failonerror="false" />
                <mkdir dir="${build-dir}" />
                <mkdir dir="${classes-dir}" />
        </target>

        <!--====================================================================== -->

        <target name="test2" depends="init">
                <!-- first generate a list of libraries (jars) as a ':' seprated list -->
                <fileset id="eazycnc-libs-fileset" dir="lib" includes="**" />
                <property name="prop.dist.contents" refid="eazycnc-libs-fileset" />
                <pathconvert targetos="unix" pathsep=":" property="eazycnc-libs-list" refid="eazycnc-libs-fileset">
                        <mapper>
                                <globmapper from="${basedir}/*" to="*" handledirsep="true" />
                        </mapper>
                </pathconvert>
                <echo>${eazycnc-libs-list}</echo>

                <!-- use jpackage (from jdk13!!) to package the app -->
                <exec executable="${jpackage}" dir=".">
                        <arg value="create-image" />
                        <arg value="--force" />
                        <arg value="--verbose" />
                        <arg value="--add-modules" />
                        <arg value="java.base,java.desktop" />
                        <arg value="--input" />
                        <arg value="." />
                        <arg value="--output" />
                        <arg value="." />
                        <arg value="--name" />
                        <arg value="EazyCNC" />
                        <arg value="--main-jar" />
                        <arg value="build/EazyCNC.jar" />
                        <arg value="--jvm-args" />
                        <arg value="-Xmx1024m -XX:+UseG1GC -XX:MaxGCPauseMillis=50 -XX:+PrintGC" />
                        <arg value="--resource-dir" />
                        <arg value="package-resources/macos" />
                        <arg value="--files" />
                        <arg value="build/EazyCNC.jar:${eazycnc-libs-list}" />
                        <arg value="--runtime-image" />
                        <arg value="eazycnc-java-runtime" />
                </exec>
                <!-- first generate a list of libraries (jars) as a ':' seprated list -->
                <fileset id="eazycnc-libs-fileset" dir="lib" includes="**" />
                <property name="prop.dist.contents" refid="eazycnc-libs-fileset" />
                <pathconvert targetos="unix" pathsep="${pathsep}" property="eazycnc-libs-list" refid="eazycnc-libs-fileset">
                        <mapper>
                                <globmapper from="${basedir}/*" to="*" handledirsep="true" />
                        </mapper>
                </pathconvert>
                <echo>${eazycnc-libs-list}</echo>
       
                <!-- use jpackage (from jdk13!!) to package the app -->
                        <exec executable="${jpackage}" dir=".">
                                <!-- <arg value="create-installer" />
                                <arg value="dmg" /> -->
                                <arg value="${create-what}" />
                                <arg value="--force" />
                                <arg value="--verbose" />
                                <arg value="--add-modules" />
                                <arg value="java.base,java.desktop" />
                                <arg value="--input" />
                                <arg value="." />
                                <arg value="--output" />
                                <arg value="bundles/" />
                                <arg value="--name" />
                                <arg value="EazyCNC" />
                                <arg value="--main-jar" />
                                <arg value="build/EazyCNC.jar" />
                                <arg value="--jvm-args" />
                                <arg value="-Xmx1024m -XX:+UseG1GC -XX:MaxGCPauseMillis=50 -XX:+PrintGC" />
                                <arg value="--resource-dir" />
                                <arg value="${resource-dir}" />
                                <arg value="--files" />
                                <arg value="build/EazyCNC.jar${pathsep}${eazycnc-libs-list}" />
                                <arg value="--runtime-image" />
                                <arg value="eazycnc-java-runtime" />
                        </exec>








>
> TBH I never tried it yet, as I am still doing my janitor rounds
> to release 2.4.0 - currently tackling the Android builds.
>
> <https://jogamp.org/wiki/index.php?title=SW_Tracking_Report_Feature_Objectives_Overview#Java_11>
>
> Goal for 2.4.0 is Bug 1363, i.e. working with Java 11.
> Any issue with Java 11+ features should be resolved with Bug 1404.
>
> But this seems to be a great forward looking discussion,
> so maybe you like to elaborate as asked above.

I'm willing to help as I can but I may need some hand holding. Thanks.

>
> Maybe best if you can send me a private email,
> so I can give you bugzilla access - managing this issue there,
> as a blocking dependency to Bug 1404.
>
> You shall also state what is working already there.

So how do I send you private mail?

wbr Kusti



>
> Thank you.

Thank you!