java.lang.UnsatisfiedLinkError in an app packaged with jpackager

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

java.lang.UnsatisfiedLinkError in an app packaged with jpackager

eazycncn
I'm moving my application to use jpackager.
This works in macOS.
On Windows 10 I get following error:


java.lang.UnsatisfiedLinkError: Can't load library: C:\Program Files\EazyCNC\app\natives\windows-amd64\\gluegen-rt.dll
        at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.base/java.lang.Runtime.load0(Unknown Source)
        at java.base/java.lang.System.load(Unknown Source)
        at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:624)
        at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:106)
        at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:487)
        at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:427)
        at com.jogamp.common.os.Platform$1.run(Platform.java:317)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at com.jogamp.common.os.Platform.<clinit>(Platform.java:287)
        at com.jogamp.opengl.GLProfile.<clinit>(GLProfile.java:147)
        at swing.SwingWidgetFactory.greateOpenGLView(Unknown Source)


In Windows the jpackager creates an installer that unpacks the code to

C:\Program Files\EazyCNC\

and all the jars into

C:\Program Files\EazyCNC\lib

and all jogl stuff to

C:\Program Files\EazyCNC\lib\jogljars11

which contains these files:

gluegen-rt-natives-linux-amd64.jar
gluegen-rt-natives-macosx-universal.jar
gluegen-rt-natives-windows-amd64.jar
gluegen-rt.jar
gluegen.jar
jocl-natives-macosx-universal.jar
jocl.jar
jogl-all-natives-linux-amd64.jar
jogl-all-natives-macosx-universal.jar
jogl-all-natives-windows-amd64.jar
jogl-all.jar
jogl.jar

I'm at loss how to debug this further or what to try so I'm asking for ideas.

FYI: I'm using jdk-11.0.2 but jpacke is from jdk-13 because the 11.0.2 version has bugs.

wbr Kusti
Reply | Threaded
Open this post in threaded view
|

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

Sven Gothel
Administrator
Which JogAmp modules and _version_ are you using?
(Assuming you use the latest tip of the master branches)

Show us the jpackager recipe.

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.

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.

Thank you.

On 12/14/19 5:30 PM, eazycncn [via jogamp] wrote:

> I'm moving my application to use jpackager.
> This works in macOS.
> On Windows 10 I get following error:
>
>
> java.lang.UnsatisfiedLinkError: Can't load library: C:\Program
> Files\EazyCNC\app\natives\windows-amd64\\gluegen-rt.dll
>         at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
>         at java.base/java.lang.Runtime.load0(Unknown Source)
>         at java.base/java.lang.System.load(Unknown Source)
>         at
> com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:624)
>
>         at
> com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:106)
>
>         at
> com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:487)
>         at
> com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:427)
>
>         at com.jogamp.common.os.Platform$1.run(Platform.java:317)
>         at java.base/java.security.AccessController.doPrivileged(Native Method)
>         at com.jogamp.common.os.Platform.<clinit>(Platform.java:287)
>         at com.jogamp.opengl.GLProfile.<clinit>(GLProfile.java:147)
>         at swing.SwingWidgetFactory.greateOpenGLView(Unknown Source)
>
>
> In Windows the jpackager creates an installer that unpacks the code to
>
> C:\Program Files\EazyCNC\
>
> and all the jars into
>
> C:\Program Files\EazyCNC\lib
>
> and all jogl stuff to
>
> C:\Program Files\EazyCNC\lib\jogljars11
>
> which contains these files:
>
> gluegen-rt-natives-linux-amd64.jar
> gluegen-rt-natives-macosx-universal.jar
> gluegen-rt-natives-windows-amd64.jar
> gluegen-rt.jar
> gluegen.jar
> jocl-natives-macosx-universal.jar
> jocl.jar
> jogl-all-natives-linux-amd64.jar
> jogl-all-natives-macosx-universal.jar
> jogl-all-natives-windows-amd64.jar
> jogl-all.jar
> jogl.jar
>
> I'm at loss how to debug this further or what to try so I'm asking for ideas.
>
> FYI: I'm using jdk-11.0.2 but jpacke is from jdk-13 because the 11.0.2 version
> has bugs.
>
> wbr Kusti
>
>
> ------------------------------------------------------------------------------
> If you reply to this email, your message will be added to the discussion below:
> http://forum.jogamp.org/java-lang-UnsatisfiedLinkError-in-an-app-packaged-with-jpackager-tp4040180.html
>
> To start a new topic under jogl, email [hidden email]
> To unsubscribe from jogl, click here
> <
> NAML
> <
http://forum.jogamp.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
health & wealth
mailto:[hidden email] ; http://jausoft.com
land : +49 (471) 4707742 ; fax : +49 (471) 4707741
Timezone CET: PST+9, EST+6, UTC+1
Reply | Threaded
Open this post in threaded view
|

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

eazycncn


> 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!


Reply | Threaded
Open this post in threaded view
|

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

Sven Gothel
Administrator
On 12/14/19 5:52 PM, eazycncn [via jogamp] wrote:
>
>
>> 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.
>
Please use our git repo:
  https://jogamp.org/cgit/

>
>> (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:
thank you

/snip

>
> So how do I send you private mail?
>
> wbr Kusti

https://jogamp.org/wiki/index.php/Maintainer_and_Contacts#Sven_Gothel
Reply | Threaded
Open this post in threaded view
|

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

eazycncn
In reply to this post by Sven Gothel
Is the there a ready built 2.4.0 (pre release) available for download somewhere?

wbr Kusti
Reply | Threaded
Open this post in threaded view
|

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

Sven Gothel
Administrator
On 12/14/19 6:42 PM, eazycncn [via jogamp] wrote:
> Is the there a ready built 2.4.0 (pre release) available for download somewhere?

Only after I am through the Android configurations
- x86
- arm64
- armv7

Soon .. most is done by now.

But maybe a good exercise to build yourself

https://jogamp.org/gluegen/doc/HowToBuild.html
https://jogamp.org/jogl/doc/HowToBuild.html

~Sven

>
> wbr Kusti
>


signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

eazycncn


> On 14 Dec 2019, at 20.21, Sven Gothel [via jogamp] <[hidden email]> wrote:
>
> On 12/14/19 6:42 PM, eazycncn [via jogamp] wrote:
> > Is the there a ready built 2.4.0 (pre release) available for download somewhere?
>
> Only after I am through the Android configurations
> - x86
> - arm64
> - armv7
>
> Soon .. most is done by now.
>
> But maybe a good exercise to build yourself
>
> https://jogamp.org/gluegen/doc/HowToBuild.html
> https://jogamp.org/jogl/doc/HowToBuild.html
>
> ~Sven
>

Thanks!

Sounds fun but I think I will wait for the your builds as I've got
lots of things on my todo list before xmas so if your builds
are ready by then I can then work on this issue between xmas and
new year.

wbr Kusti

Reply | Threaded
Open this post in threaded view
|

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

eazycncn
Just reporting back:

Today I moved my development from VirtualBox to a real PC
and from Windows 10 to Windows 7.

And now the jpackage:ed code which uses JOGL 2.0.4 as
reported works just fine, at least on Windows 7.

wbr Kusti