Bug 1526

Summary: JarUtil::getJarBasename: Remove '.jar' suffix check of result
Product: [JogAmp] Gluegen Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: 2.6.0   
Hardware: All   
OS: all   
Type: DEFECT SCM Refs:
978a9661c1b9e28ecd02612d85a9ded7bde1878c
Workaround: ---

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.