Open tmulle opened 1 year ago
Thanks, tmulle , for the detailed report.
In the frame of further evolution of ESA's SNAP (http://step.esa.int/main/toolboxes/snap/), we are trying to integrate Worldwind 2.2.1 on MacOS M1 Arm with Java11. We are finally observing exactly the same kind of exceptions A and B as listed above. Our setup is similar:
openjdk 11.0.19 2023-04-18 LTS OpenJDK Runtime Environment (build 11.0.19+7-LTS) OpenJDK 64-Bit Server VM (build 11.0.19+7-LTS, mixed mode)
Darwin macstudio.bc.local 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar 6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000 arm64
A suggestion for a fix or workaround would be much appreciated.
@dolaf based on the information in this ticket https://github.com/NASAWorldWind/WorldWindJava/issues/261
I download the latest jars from https://jogamp.org/deployment/v2.4.0/jar/ and replaced all the ones in the WorldWind 2.2.1
directory when I unzipped the file.
I was then able to run the demo app sh run-demo.bash
and the application worked and I saw the default plain globe and could move around with the mouse, etc.
Make sure you remove -Djogamp.gluegen.UseTempJarCache=false
if you added to the command line or in the NetBeans RUN launcher for the example applications. I accidentally left it in and the IDE wasn't running the demos. Once I removed that property things worked with the automatic loading like it should.
Hopefully, this will help you as well.
Here are the jars I replaced for my M1 Mac:
Demo Working from command line:
I was also able to run the demo applications in the Netbeans IDE. I just had to replace the libs that were set in the project with the newly downloaded ones: (I created a Library called M1 Glugen/JOGL)
Demo application working from NetBeans IDE:
@tmulle: This is great news, thanks a lot for the info! We will give it a try and report back to you... Cheers, Olaf
@tmulle: In the meantime I replaced the jars as you suggested. Unfortunately, in our application this ends up in the error shown below. Have you ever seen this?
@dolaf No sorry.. what version of SNAP are you using? I downloaded SNAP yesterday version 9 on my Mac and when I ran it for the first time I was able to see the WorldWind globe in the application. I didn't even have to replace any jars.
Unfortunately, after doing plugin upgrades as the IDE suggested, the application seemed to have broken. It loaded but no windows were visible anymore.
I uninstalled it since I have no need for the application, I just wanted to see what the SNAP tool was.
Maybe check your logs for the SNAP application and it will give you more information on the error. I wasn't able to find anything useful for MacOS based on the screenshot you sent. There were similar errors on Linux, but people said it seemed to resolve itself after system/graphics driver updates. So, not helpful :(
Description
Downloading the 2.2.1.zip and attempting to run either the
run-demo.bash
or any of the example applications (ie.Airspaces.java
from the source tree using NetBeans IDE fails to load the JOGL libs on my M1 ARM MacOS.When I attempt to disable the automatic loading of the libraries using
-Djogamp.gluegen.UseTempJarCache=false
as described here https://jogamp.org/jogl/doc/userguide/index.html#traditionallibraryloading I get a different error as show below.From above link:
Automated Native Library Loading
JOGL 2.0 has a brand new feature allowing to automatically extract the proper native libraries required to use JOGL from JARs containing them without relying on the Java library path or any platform-dependent environment variable allowing to set the location of native libraries. This allows desktop applications as well as traditional Applets as NApplets to utilize the native library JAR files the same way Webstart/JNLP does.
To allow the native JAR file library loading to work, ensure that all JogAmp JAR files are left unmodified within their common directory.
In case the native library JAR files cannot be opened, it falls back to the traditional native library loading mechanism via the java library path.
This feature is enabled by default and - for whatever reason - it can be disabled by setting the property jogamp.gluegen.UseTempJarCache to false (as a VM argument, -Djogamp.gluegen.UseTempJarCache=false in command line).
Traditional Native Library Loading
If you don't use automatic native libraries loading, as enabled by default, you must set either the VM property java.library.path or the platform-dependent environment variable used for the location of native libraries, PATH on Windows, LD_LIBRARY_PATH on Unix (Linux, Solaris, ..) and DYLD_LIBRARY_PATH on Mac OS X. The environment variable shall contain the full path to the "lib" directory; for example, on Windows, add "C:\Users\myhome\jogamp-all-platforms\lib\windows-amd64" to your PATH using the System control panel, Advanced tab, Environment Variables button. At this point your Java installation should be able to see the Jogl class files.
Steps to Reproduce
Automatic Loading To Run the demo app as stated in the README
run-demo.bash
scriptTo run the examples from the source in NetBeans IDE:
Worldwind
project in the Netbeans IDEsrc/gov/nasa/worldwindx/examples/Airspaces.java
and choose 'Run File'Disabling Automatic Loading To Run the demo app as stated in the README
-Djogamp.gluegen.UseTempJarCache=false
to thejava
commandrun-demo.bash
scriptTo run the examples from the source in NetBeans IDE:
Worldwind
project in the Netbeans IDE-Djogamp.gluegen.UseTempJarCache=false
to theRun
properties of the projectsrc/gov/nasa/worldwindx/examples/Airspaces.java
and choose 'Run File'Expected behavior: To be able to launch any of the demo code
Actual behavior:
EXCEPTION A All fail with this exception:
EXCEPTION B
Reproduces how often: [What percentage of the time does it reproduce?] 100%
Operating System and Version
[What operating system and version are you using?] Darwin mars.local 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct 9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000 arm64
Additional Information
Java Versions Tried:
Any additional information, configuration or data that might be necessary to reproduce the issue.