#7 Validation error when using dontWrapJar=true

2.x
closed-fixed
General (55)
5
2006-01-25
2006-01-11
No

In version 2.1.0, I have set
dontWrapJar="true"
jar="example.jar"

I get this error:

net.sf.launch4j.BuilderException:
!Config.application.jar.path!

I believe this is because the Jar argument in Config is
of type File instead of String. When File#getPath is
called to pass to Validator.checkRelativeWinPath, the
result (at least on my system) is an absolute path.
When dontWrapJar is true, the raw String value of the
jar property should be used. I think :-)

Thanks,
Chris

Discussion

  • Grzegorz Kowal

    Grzegorz Kowal - 2006-01-12
    • assigned_to: nobody --> grzegok
     
  • Grzegorz Kowal

    Grzegorz Kowal - 2006-01-12

    Logged In: YES
    user_id=917657

    One thing that's certain is the lack of an error message for
    'Config.application.jar.path' code. I couldn't reproduce the
    bug though on Linux as well as Windows Xp.
    Validator.checkRelativeWinPath basically checks that the
    path doesn't start with '/' or '\' and doesn't contain ':',
    it should accept 'example.jar'.

    Can you provide more details like: OS type (is it MacOS X?),
    Java version and your config file?

    Grzegorz

     
  • Chris Nokleberg

    Chris Nokleberg - 2006-01-12

    Logged In: YES
    user_id=594737

    I'm embedding the config via an ant task, which now that I
    think about it may very well be the source of the problem.

    I'm running on Linux, JDK 1.5.0_06, Ant 1.6.2.

    I've attached an example ant task which should demonstrate
    the problem.

    Thanks,
    Chris

    <target name="exe" depends="jar">
    <taskdef name="launch4j"
    classname="net.sf.launch4j.ant.Launch4jTask"
    classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar"/>
    <launch4j>
    <config headerType="0" jar="example.jar"
    outfile="dist/example.exe"
    errTitle="EXAMPLE" dontWrapJar="true">
    <jre minVersion="1.4.0"/>
    <versionInfo
    fileVersion="1.0.0.0"
    txtFileVersion="1.0"
    productVersion="1.0.0.0"
    txtProductVersion="1.0"
    fileDescription="EXAMPLE"
    copyright="Copyright (c) 2005 Tonic
    Systems, Inc."
    productName="EXAMPLE"
    companyName="Tonic Systems, Inc."
    internalName="example"
    originalFilename="example.exe"/>
    </config>
    </launch4j>
    </target>

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2006-01-13

    Launch4jTask.java

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2006-01-13

    Logged In: YES
    user_id=917657

    It's because Ant transforms relative paths into absolute
    paths. I've attached the source and class file of the
    corrected Ant task. Bugfix release soon.

    Grzegorz

     
  • Chris Nokleberg

    Chris Nokleberg - 2006-01-21

    Logged In: YES
    user_id=594737

    Thanks for the bugfix, looking forward to the next release
    (for some reason launch4j crashes when I run from a manually
    patched & built jar)

    Chris

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2006-01-21

    Logged In: YES
    user_id=917657

    I'll upload 2.1.1 in a couple of days.

    Grzegorz

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2006-01-25
    • status: open --> closed-fixed
     

Log in to post a comment.