file name with dash does not work.

mxnerd
2011-05-17
2013-06-12
  • mxnerd
    mxnerd
    2011-05-17

    Hi:

      I'm trying to wrap an existing application with several jar files.  Two of them has dash character "-" in the string.

    It seems launch4j can't take file name that has dash "-" in it.   The error is

    Fatal Error: one of the following jar files is missing from the classpath:
       jfreechart-1.0.9.jar
       jcommon-1.0.12.jar
    Please make sure you run the application from the shortcut that was
    installed on your desktop or on the Start menu when you upgraded.

    I tried to add "\" in front of "-", but it doesn't work.

    How can I fix it?  I don't want to change file names.

    I'm running the application from Windows.

    Thanks.

     
  • mxnerd
    mxnerd
    2011-05-17

    The original command line is
    C:\Windows\SysWOW64\javaw.exe -cp jts.jar;hsqldb.jar;jcommon-1.0.12.jar;jfreechart-1.0.9.jar;jhall.jar;other.jar;rss.jar -Dsun.java2d.noddraw=true -Xmx512M jclient/LoginFrame C:\Jts

    In launch4j GUI I checked  Custom classpath, main class is jclient.LoginFrame, and in Classpath I entered
    hsqldb.jar
    jcommon-1.0.12.jar
    jfreechart-1.0.9.jar
    jhall.jar
    other.jar
    rss.jar

    Even if I change file name in Windows and change classpath to jcommon.jar & jfreechart.jar in launch4j, after compilation and launching the exe, it still give same error message.

     
  • mxnerd
    mxnerd
    2011-05-17

    My bad.  It's not just those 2 files.   I found that I need to use absolute file path for all classpath entries.

    Now it's solved.