Windows app failing to construct Canvas3D

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

Windows app failing to construct Canvas3D

pierrebierre
This post was updated on .
I'm a math education developer with my own custom app (DataflowGeometry3D).  I have to support MacOS and Windows,
and use the same source code base (and Eclipse IDEs), but different installers for the 2 platforms.  The Mac side is working perfect up through online app distribution.

The Windows installer worked previously (DataflowGeometry2D), but that was before I added Java3D.

Launched from within Win Eclipse, the DataflowGeometry3D app runs perfect.  No compile or link errors.

But, if I have Win Eclipse build a RunnableJar, and launch from the Command Line, when trying to construct the Canvas3D,
it cannot find a suitable AWTGraphicsConfiguration because "<local3> is null".

Would this be a missing *.dll file that the Windows NSI Installer needs to put on the hard drive?  Something else?

thanks, Pierre

Win Java architecture:

Non-Modular
Java 8 (last update)
Swing & AWT
Java3D 1.6.0. & Jogamp-fat (version??)

The HP I'm building on has a GPU.  Would it matter if it didn't?
Reply | Threaded
Open this post in threaded view
|

Re: Windows app failing to construct Canvas3D

gouessej
Administrator
This post was updated on .
Hello

Please indicate which version of JOGL you use, which JOGL JAR(s) (the exact name) you deploy with your software and the full stack trace. I suspect that when you try your JAR, it uses Java >= 9 instead of Java 8, some --add-opens clauses are then missing and you get a NullPointerException. I might be completely wrong, but I need to know a lot more to make some suggestions. Which command line do you use to run your program?

By the way, Java 8 is obsolete and shouldn't be used.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Windows app failing to construct Canvas3D

pierrebierre
Hi Julien,  I would be only too happy to drop Java8 and build my Win app with Java16.  The MacOS version of the same app (Mac Intel hw) works perfectly with Java 16, Java3D 1.6.0 and jogamp-fat.jar.

BTW, how do I determine which version of a jogamp-fat.jar I'm using?  It's not externally visible.

For WINDOWS 11, and Java 16,
         Which release of Java3D should I use?
         Which release of jogamp-fat?
         Anything else my Windows app Installer needs to install?  Any PATH variables to add?

thanks, Pierre
Reply | Threaded
Open this post in threaded view
|

Re: Windows app failing to construct Canvas3D

gouessej
Administrator
Look at META-INF/MANIFEST.MF in jogamp-fat.jar to find the JOGL version you use. I advise you to use at least JOGL 2.5.0.

If you want to use Java >= 9, you'll have to add the missing --add-opens clauses.

Java3D 1.6 and 1.7 use different namespaces. Try at least to use the latest release of the major version.

I still need the full stack trace to be sure that it's just a problem of missing modules.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Windows app failing to construct Canvas3D

pierrebierre
This post was updated on .
Julien -

THIS IS A NON MODULAR JAVA APP.

I confirmed version info by printing out the J3d Properties to the console:

Java3D Version: 1.6.0 fcs fcs
Java3D: Vendor:
Java3D: Renderer: OpenGL  (jogamp-fat version 16.0.2 from Oracle, as read out from extracted MANIFEST)

Java runtime version 16.0.2

16.0.2+7-67
Oracle Corporation

I got past the Eclipse launch today, and was able to launch from the Windows Command Line by simply copying the launch string from the Eclipse Run Config.  It does include the

--add-opens java.desktop/sun.awt=ALL-UNNAMED

as the first java.exe option listed after the java.exe command.

This is real progress.

I believe I'm now back on the road to a Win Installer for my DataflowGeometry3D app.  Will confirm that when it's working.
Reply | Threaded
Open this post in threaded view
|

Re: Windows app failing to construct Canvas3D

gouessej
Administrator
I wanted you to give me the value of the field named "Implementation-Version" in the manifest. This is what appears for jogamp-fat.jar in JOGL 2.5.0:
Implementation-Version: 2.5.0

Please do the same for Java3D. The latest update contains fixes that might be helpful.

You have to use --add-opens even for non modular programs.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Windows app failing to construct Canvas3D

pbierre
Julien , merci beaucoup!!  The Windows Installer was completed (using old NSI freeware, if anyone is interested).

The only hangup was the missing JVM Launch argument

--add-opens java.desktop/sun.awt=ALL-UNNAMED


which has to come BEFORE any other VM args (like -splash "SplashScreen.png").

I especially appreciate how the same

jogamp-fat.jar

can be used on my 3 different supported platforms: Win, Mac(intel), Mac(apple).   The promise of Java (platform independence) voiced by Bill Joy now ~30 years ago DELIVERS ONCE AGAIN.  

Je suis tres heureux. - Pierre
Reply | Threaded
Open this post in threaded view
|

Re: Windows app failing to construct Canvas3D

Sven Gothel
Administrator
pbierre wrote
I especially appreciate how the same

jogamp-fat.jar

can be used on my 3 different supported platforms: Win, Mac(intel), Mac(apple).   The promise of Java (platform independence) voiced by Bill Joy now ~30 years ago DELIVERS ONCE AGAIN.  
Thank you, that was the intention of the *fat* feature.
In today's world, the footprint costs of an additional ~3 MB
for the native libraries are cheap.

- jogamp-fat.jar 13MB (2.6.0)
  - contains 7 os-and-arch tuples today, macos is 2
  - without OpenAL it would be only ~7MB
  - javaonly 4.8MB

- One platform, e.g. linux-amd64:
  - deflated 3 MB (OpenAL takes ~2MB, biggest chunk)
  - inflated  1.4MB (w/o OpenAL ~300kB only)

(sorry for the re-edits, this got me curious)
Reply | Threaded
Open this post in threaded view
|

Re: Windows app failing to construct Canvas3D

Sven Gothel
Administrator
In reply to this post by pierrebierre
Reply | Threaded
Open this post in threaded view
|

Re: Windows app failing to construct Canvas3D

hharrison
In reply to this post by Sven Gothel
I'm curious what you were counting towards the OpenAL size in the fat-jar, is it a fairly well-defined set of folders in the jar I could strip to make the jaamsim distribution a bit smaller, we're currently around 18-19MB, so a savings of 6MB or so would be a pretty big difference for us.

Harvey
Reply | Threaded
Open this post in threaded view
|

Re: Windows app failing to construct Canvas3D

hharrison
Quick follow up...nevermind my question as I had already changed to using jogl-all.jar to avoid all the non-jogl bits instead of the fat jar....I guess I got excited over a free lunch, ha ha.

Harvey
Reply | Threaded
Open this post in threaded view
|

Re: Windows app failing to construct Canvas3D

Sven Gothel
Administrator
In reply to this post by hharrison
To get the non-OpenAL native lib version, I just deflated to a temp folder and inside this I did a
find natives -iname \*openal\* -delete
zip -r ../jogamp-fat-no_openal.jar *
Reply | Threaded
Open this post in threaded view
|

Re: Windows app failing to construct Canvas3D

Sven Gothel
Administrator
In reply to this post by hharrison
it is sort of a free lunch, just arrange whatever you need into the fat jar structure
and you are good to go using the same native temp jar cache loading mechanism .. AFAIK.
Reply | Threaded
Open this post in threaded view
|

Re: Windows app failing to construct Canvas3D

hharrison
Yep, that's what we do to deploy jaamsim, the fat jar and native cache loading mechanism works perfectly for us. It was also pretty simple to do in our build files, see the jaamsim project build.xml for the relatively simple details.

https://github.com/jaamsim/jaamsim/blob/master/build.xml

Harvey