Menu

#117 EXE cannot be launched from launch4j or Java, but from Explorer when using relative classpath

3.x
open
nobody
None
7
2017-05-31
2017-05-09
ToFi
No

When working with relative paths for <jar> and <outfile> and <classpath>, the EXE can neither be launched by launch4j GUI app, nor by another Java tool via Desktop.getDesktop.open(). It would always result in a JNI error. However, the EXE can be launched from Explorer without any problems.

The issue is solved, when I set "Change dir" to . (was previously empty).

I would expect, that . on "Change dir" is the default/fallback if no other value is provided.

Discussion

  • ToFi

    ToFi - 2017-05-09

    This happens with 3.9 by the way...

     
  • ToFi

    ToFi - 2017-05-09

    The JNI error is thrown with two GUI dialogs popping up, plus, at elast in launch4j, there's a stacktrace message, that indicates, that some classes are not found.
    That's why I guess, my classpath entry ./lib/* is a problem for launch4j without the "Changedir" .

    I also tried lib/*, but it would also only work with Changedir ..

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2017-05-17
     
  • Grzegorz Kowal

    Grzegorz Kowal - 2017-05-17

    Currently JNI requires that chdir is set to '.' as outlined in the documentation. It is the default when creating a new configuration in the GUI, but does not work as fallback for backward compatibility.

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2017-05-17

    Ticket moved from /p/launch4j/bugs/166/

     
  • ToFi

    ToFi - 2017-05-17

    But I don't use JNI. I'm using the default (old) method...

     
  • ToFi

    ToFi - 2017-05-31
    Post awaiting moderation.

Log in to post a comment.