"No Jar name in..." Errors

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

"No Jar name in..." Errors

MDHillman
Hi all,

I'm trying to figure out the source of some IllegalArgumentException errors I'm getting (see below for output). Strange thing is, using the exact same program & libraries, with the same Java version and OS architecture, I can reproduce this error on one machine but not another. I've added the Gluegen-rt-main and Jogl-all-main dependancies via Maven, anyone have any thoughts?

Catched IllegalArgumentException: No Jar name in <jar:file:/C:/Program%20Files/foo/bar.exe!/com/jogamp/common/os/Platform.class>, got <bar.exe>, while TempJarCache.bootstrapNativeLib() of null (null + null)
Reply | Threaded
Open this post in threaded view
|

Re: "No Jar name in..." Errors

gouessej
Administrator
Hi

What do you use to package your application? We are responsible for troubles caused by third party packagers.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: "No Jar name in..." Errors

MDHillman
I'm using NetBeans v 7.1.2 to build a Jar file which is then wrapped into an executable using Launch4J.
Reply | Threaded
Open this post in threaded view
|

Re: "No Jar name in..." Errors

gouessej
Administrator
JogAmp APIs support Java Web Start. The "fat JAR" approach isn't supported yet. You can make it work, a few users succeeded in doing so but it will be a bit tricky. Maybe some contributors could write a proper request for enhancement so that the developers can just merge all JARs into one and load the native libraries from it.

You can manually load the DLLs in your code and deploy them as separate files.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: "No Jar name in..." Errors

PLarsson
Hello many years later :)

I'm trying to use jogamp in a fat jar wrapped in an exe by launch4j. I understand that this is not officially supported. But looking at the code in JarUtil.java, there is at least one bug (as far as I can tell).

This code...
if(0 >= ssp.lastIndexOf(".jar")) {
    throw new IllegalArgumentException("No Jar name in <"+classJarUri+">");
}
... checks that the archive file name contains ".jar", not that it actually ends in ".jar". This has the interesting side effect that if I just rename my ReallyAwesomeProgram.exe to f.ex. ReallyAwe.jarsomeProgram.exe, everything suddenly works!

So... my usecase technically works, but is hindered by this file name check, which is incorrect so I can bypass it in ugly ways.

Do what you want with this info. I'd of course prefer if you just removed the file name check. But if you keep it I'd change it to ssp.endsWith(...).
Reply | Threaded
Open this post in threaded view
|

Re: "No Jar name in..." Errors

Sven Gothel
Administrator
Thank you!

Let me read through a little to figure out potential side effects,
if removing this suffix check.

Yes, the suffix check itself is also not 'ideal' :)
Reply | Threaded
Open this post in threaded view
|

Re: "No Jar name in..." Errors

hharrison
In reply to this post by PLarsson
You can see the solution we used in JaamSim to bundle jogl in the launch4j laucher here:

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

(basically unpacks the jogl fat jar and natives and packages all in a single extra-fat jar)

Probably this should also get changed, but thought I'd share another solution for reference.

Harvey
Reply | Threaded
Open this post in threaded view
|

Re: "No Jar name in..." Errors

Sven Gothel
Administrator
In reply to this post by PLarsson