Bug 1526 - JarUtil::getJarBasename: Remove '.jar' suffix check of result
Summary: JarUtil::getJarBasename: Remove '.jar' suffix check of result
Status: RESOLVED FIXED
Alias: None
Product: Gluegen
Classification: JogAmp
Component: core (show other bugs)
Version: 2.6.0
Hardware: All all
: P4 normal
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2025-08-22 08:00 CEST by Sven Gothel
Modified: 2025-08-22 08:06 CEST (History)
0 users

See Also:
Type: DEFECT
SCM Refs:
978a9661c1b9e28ecd02612d85a9ded7bde1878c
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2025-08-22 08:00:14 CEST
PLarsson reported incompatibility using jogamp's fat jar wrapped in an exe by launch4j.
See https://forum.jogamp.org/No-Jar-name-in-Errors-tp4028798p4043856.html

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.
Comment 1 Sven Gothel 2025-08-22 08:06:58 CEST
commit 978a9661c1b9e28ecd02612d85a9ded7bde1878c
fixed as described.