如何正确设置路径

如何正确设置路径

本文介绍了Launch4j / windres:如何正确设置路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我launch4j配置我的项目。我用它回来,当我在WindowsXP中,在那里工作的发展。现在我需要它构建在Mac以及

我的build.xml文件:

 <?XML版本=1.0编码=UTF-8独立=无&GT?;
<项目默认为创建-EXE>    <属性名=平台价值=的win32/>
    <属性名=launch4j.dir位置=$ {} BASEDIR /工具/ launch4j //>    <包括文件=创建-jar.xml中的为=亚健康/>    <目标名称=创建-EXE取决于=sub.create-JAR>
        < launch4j CONFIGFILE =launch4j-config.xml文件/>
        <删除文件=client.win32.jar/>
    < /目标与GT;    <的taskdef NAME =launch4j类名=net.sf.launch4j.ant.Launch4jTask>
        <&类路径GT;
            < pathelement路径=工具/ launch4j / launch4j.jar/>
            < pathelement路径=工具/ launch4j / lib目录/ xstream.jar/>
        < /类路径>
    < /&的taskdef GT;
< /项目>

我得到以下的输出:

 创建-EXE:
 [launch4j]编译资源
 [launch4j]生成的资源文件...
 [launch4j]语言0,1
 [launch4j] 2 RCDATA BEGIN1.6.0 \\ 0END
 [launch4j] 18 RCDATA BEGIN0 \\ 0END
 [launch4j] 25 RCDATA BEGIN512 \\ 0END
 [launch4j] 27 RCDATA BEGIN1024 \\ 0END
 [launch4j] 21 RCDATA BEGINhttp://java.com/download\\0END
 [launch4j] 20 RCDATA BEGIN32 \\ 0END
 [launch4j] 9 RCDATA BEGIN真\\ 0END
 [launch4j] 101 RCDATA BEGIN时发生错误,启动应用程序。\\ 0END
 [launch4j] 102 RCDATA BEGIN该应用程序配置为使用捆绑的Java运行时环境,但运行时丢失或损坏。\\ 0END
 [launch4j] 103 RCDATA BEGIN此应用程序需要Java运行时环境\\ 0END
 [launch4j] 104 RCDATA BEGIN注册表指的是一个不存在的Java运行时环境的安装或运行时被破坏。\\ 0END
 [launch4j] 17 RCDATA BEGIN真\\ 0END构建失败
/Users/fabian/dev/rsys-client/create-win32-exe.xml:9:net.sf.launch4j.BuilderException:net.sf.launch4j.ExecException:java.io.IOException异常:不能运行程序./bin / windres:错误= 2,没有这样的文件或目录

当我添加 BINDIR =工具/ launch4j / BIN来的launch4j-执行,LD和windres发现,输出变为:

 创建-EXE:
 [launch4j]编译资源
 [launch4j]链接
 [launch4j] /用户/法比安的/ dev / RSYS客户端/工具/ launch4j /斌/劳工处:找不到./w32api/crt2.o:没有这样的文件或目录
 [launch4j] /用户/法比安的/ dev / RSYS客户端/工具/ launch4j /斌/劳工处:找不到./head/guihead.o:没有这样的文件或目录
 [launch4j] /用户/法比安的/ dev / RSYS客户端/工具/ launch4j /斌/劳工处:找不到./head/head.o:没有这样的文件或目录
 [launch4j] /用户/法比安的/ dev / RSYS客户端/工具/ launch4j /斌/劳工处:找不到./w32api/libmingw32.a:没有这样的文件或目录
 [launch4j] /用户/法比安的/ dev / RSYS客户端/工具/ launch4j /斌/劳工处:找不到./w32api/libgcc.a:没有这样的文件或目录
 [launch4j] /用户/法比安的/ dev / RSYS客户端/工具/ launch4j /斌/劳工处:找不到./w32api/libmsvcrt.a:没有这样的文件或目录
 [launch4j] /用户/法比安的/ dev / RSYS客户端/工具/ launch4j /斌/劳工处:找不到./w32api/libkernel32.a:没有这样的文件或目录
 [launch4j] /用户/法比安的/ dev / RSYS客户端/工具/ launch4j /斌/劳工处:找不到./w32api/libuser32.a:没有这样的文件或目录
 [launch4j] /用户/法比安的/ dev / RSYS客户端/工具/ launch4j /斌/劳工处:找不到./w32api/libadvapi32.a:没有这样的文件或目录
 [launch4j] /用户/法比安的/ dev / RSYS客户端/工具/ launch4j /斌/劳工处:找不到./w32api/libshel​​l32.a:没有这样的文件或目录构建失败
/Users/fabian/dev/rsys-client/create-win32-exe.xml:9:net.sf.launch4j.BuilderException:net.sf.launch4j.ExecException:执行失败(1):/用户/法比安的/ dev / RSYS客户端/工具/ launch4j /斌/劳工处-mi386pe --oformat PEI-i386的--dynamicbase --nxcompat --no-SEH --subsystem窗口-s ./w32api/crt2.o ./head/guihead.o ./head/head.o的/ var /文件夹/ N5 / 44dkvyzd00z0h5mklk_pwtch0000gn / T / launch4j3026065429236284429o ./w32api/libmingw32.a ./w32api/libgcc.a ./w32api/libmsvcrt.a ./w32api/libkernel32.a ./w32api /libuser32.a ./w32api/libadvapi32.a ./w32api/libshel​​l32.a -o /Users/fabian/dev/rsys-client/Kassa.exe总时间:6秒


解决方案

我面临同样的问题,couldn't设置正确路径/类路径,但作为一种解决方法我创建Ant构建launch4j目录中,我能得到它的工作生成的可执行文件。

I have launch4j configure for my project. I used it back, when i developed on windowsXP, where it worked. Now i need it to build on mac as well:

My build.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="create-exe">

    <property name="platform" value="win32"/>
    <property name="launch4j.dir" location="${basedir}/tools/launch4j/" />

    <include file="create-jar.xml" as="sub"/>

    <target name="create-exe" depends = "sub.create-jar">
        <launch4j configFile="launch4j-config.xml" />
        <delete file="client.win32.jar"/>
    </target>

    <taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask">
        <classpath>
            <pathelement path="tools/launch4j/launch4j.jar"/>
            <pathelement path="tools/launch4j/lib/xstream.jar"/>
        </classpath>
    </taskdef>
</project>

I get the following output:

create-exe:
 [launch4j] Compiling resources
 [launch4j] Generated resource file...
 [launch4j] LANGUAGE 0, 1
 [launch4j] 2 RCDATA BEGIN "1.6.0\0" END
 [launch4j] 18 RCDATA BEGIN "0\0" END
 [launch4j] 25 RCDATA BEGIN "512\0" END
 [launch4j] 27 RCDATA BEGIN "1024\0" END
 [launch4j] 21 RCDATA BEGIN "http://java.com/download\0" END
 [launch4j] 20 RCDATA BEGIN "32\0" END
 [launch4j] 9 RCDATA BEGIN "true\0" END
 [launch4j] 101 RCDATA BEGIN "An error occurred while starting the application.\0" END
 [launch4j] 102 RCDATA BEGIN "This application was configured to use a bundled Java Runtime Environment but the runtime is missing or corrupted.\0" END
 [launch4j] 103 RCDATA BEGIN "This application requires a Java Runtime Environment\0" END
 [launch4j] 104 RCDATA BEGIN "The registry refers to a nonexistent Java Runtime Environment installation or the runtime is corrupted.\0" END
 [launch4j] 17 RCDATA BEGIN "true\0" END

BUILD FAILED
/Users/fabian/dev/rsys-client/create-win32-exe.xml:9: net.sf.launch4j.BuilderException: net.sf.launch4j.ExecException: java.io.IOException: Cannot run program "./bin/windres": error=2, No such file or directory

When i add bindir="tools/launch4j/bin" to the launch4j-execution, ld and windres are found, and the output changes to:

create-exe:
 [launch4j] Compiling resources
 [launch4j] Linking
 [launch4j] /Users/fabian/dev/rsys-client/tools/launch4j/bin/ld: cannot find ./w32api/crt2.o: No such file or directory
 [launch4j] /Users/fabian/dev/rsys-client/tools/launch4j/bin/ld: cannot find ./head/guihead.o: No such file or directory
 [launch4j] /Users/fabian/dev/rsys-client/tools/launch4j/bin/ld: cannot find ./head/head.o: No such file or directory
 [launch4j] /Users/fabian/dev/rsys-client/tools/launch4j/bin/ld: cannot find ./w32api/libmingw32.a: No such file or directory
 [launch4j] /Users/fabian/dev/rsys-client/tools/launch4j/bin/ld: cannot find ./w32api/libgcc.a: No such file or directory
 [launch4j] /Users/fabian/dev/rsys-client/tools/launch4j/bin/ld: cannot find ./w32api/libmsvcrt.a: No such file or directory
 [launch4j] /Users/fabian/dev/rsys-client/tools/launch4j/bin/ld: cannot find ./w32api/libkernel32.a: No such file or directory
 [launch4j] /Users/fabian/dev/rsys-client/tools/launch4j/bin/ld: cannot find ./w32api/libuser32.a: No such file or directory
 [launch4j] /Users/fabian/dev/rsys-client/tools/launch4j/bin/ld: cannot find ./w32api/libadvapi32.a: No such file or directory
 [launch4j] /Users/fabian/dev/rsys-client/tools/launch4j/bin/ld: cannot find ./w32api/libshell32.a: No such file or directory

BUILD FAILED
/Users/fabian/dev/rsys-client/create-win32-exe.xml:9: net.sf.launch4j.BuilderException: net.sf.launch4j.ExecException: Exec failed (1): /Users/fabian/dev/rsys-client/tools/launch4j/bin/ld -mi386pe --oformat pei-i386 --dynamicbase --nxcompat --no-seh --subsystem windows -s ./w32api/crt2.o ./head/guihead.o ./head/head.o /var/folders/n5/44dkvyzd00z0h5mklk_pwtch0000gn/T/launch4j3026065429236284429o ./w32api/libmingw32.a ./w32api/libgcc.a ./w32api/libmsvcrt.a ./w32api/libkernel32.a ./w32api/libuser32.a ./w32api/libadvapi32.a ./w32api/libshell32.a -o /Users/fabian/dev/rsys-client/Kassa.exe

Total time: 6 seconds
解决方案

I was facing the same problem and couldn´t set the path/classpath properly but as a workaround I create the Ant build within the launch4j directory and I was able to get it work generating the executable file.

这篇关于Launch4j / windres:如何正确设置路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 10:38