Есть прога на Java. Хочу иметь возможность с помощью launch4j собрать для неё exe-файл, ибо будет гоняться не только в Линуксе, но и в винде.
Раньше на 32-битной системе сборка работала. Теперь, после перехода на 64-битную, сборка отвалилась.
Скрипт сборки:
#!/usr/bin/env bash
ant -f build_exe.xml -Dlaunch4j.dir=/usr/share/launch4j
XML-файл для Ant'а:
<project name="midea" default="exe">
<target name="exe">
<echo message="Generating Windows executable..."/>
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar"/>
<launch4j>
<config headerType="gui"
jar="out/artifacts/midea_jar/midea.jar"
outfile="out/midea.exe">
<classPath mainClass="org.pf.midea.Main" cp="out/artifacts/midea_jar/midea.jar" />
<jre minVersion="1.6.0">
<opt>-Xmx1024m</opt>
<opt>-Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel</opt>
</jre>
</config>
</launch4j>
</target>
</project>
Вывод скрипта:
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
Buildfile: /home/pf/work/devel/univer/midea/build_exe.xml
exe:
[echo] Generating Windows executable...
[launch4j] Compiling resources
[launch4j] Linking
[launch4j] /usr/share/launch4j/w32api/libmingw32.a: could not read symbols: Archive has no index; run ranlib to add one
BUILD FAILED
/home/pf/work/devel/univer/midea/build_exe.xml:6: net.sf.launch4j.BuilderException: net.sf.launch4j.ExecException: Exec failed (1): /usr/share/launch4j/bin/ld -mi386pe --oformat pei-i386 --subsystem windows -s /usr/share/launch4j/w32api/crt2.o /usr/share/launch4j/head/guihead.o /usr/share/launch4j/head/head.o /tmp/launch4j1911714212319964560o /usr/share/launch4j/w32api/libmingw32.a /usr/share/launch4j/w32api/libgcc.a /usr/share/launch4j/w32api/libmsvcrt.a /usr/share/launch4j/w32api/libkernel32.a /usr/share/launch4j/w32api/libuser32.a /usr/share/launch4j/w32api/libadvapi32.a /usr/share/launch4j/w32api/libshell32.a -o /home/pf/work/devel/univer/midea/out/midea.exe
at net.sf.launch4j.Builder.build(Builder.java:144)
at net.sf.launch4j.ant.Launch4jTask.execute(Launch4jTask.java:111)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: net.sf.launch4j.ExecException: Exec failed (1): /usr/share/launch4j/bin/ld -mi386pe --oformat pei-i386 --subsystem windows -s /usr/share/launch4j/w32api/crt2.o /usr/share/launch4j/head/guihead.o /usr/share/launch4j/head/head.o /tmp/launch4j1911714212319964560o /usr/share/launch4j/w32api/libmingw32.a /usr/share/launch4j/w32api/libgcc.a /usr/share/launch4j/w32api/libmsvcrt.a /usr/share/launch4j/w32api/libkernel32.a /usr/share/launch4j/w32api/libuser32.a /usr/share/launch4j/w32api/libadvapi32.a /usr/share/launch4j/w32api/libshell32.a -o /home/pf/work/devel/univer/midea/out/midea.exe
at net.sf.launch4j.Util.exec(Util.java:148)
at net.sf.launch4j.Cmd.exec(Builder.java:205)
at net.sf.launch4j.Builder.build(Builder.java:112)
... 18 more
Total time: 0 seconds
Что ему куда подсунуть, чтобы сборка пошла?