Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building Windows Executable File Faild #30

Closed
hallooyo opened this issue Jan 6, 2016 · 4 comments
Closed

Building Windows Executable File Faild #30

hallooyo opened this issue Jan 6, 2016 · 4 comments

Comments

@hallooyo
Copy link

hallooyo commented Jan 6, 2016

Hello All

I just added your plugin to see if I could create an executable binary, but I am getting the following error

[ERROR]

net.sf.launch4j.BuilderException: net.sf.launch4j.ExecException: Exec failed (1): /Users/bourne/Workspace/maven_m2/net/sf/launch4j/launch4j/3.5.0/launch4j-3.5.0-workdir-mac/bin/windres --preprocessor=cat -J rc -O coff -F pe-i386 /var/folders/nf/cyskjq3n6qg696ydk9y6nrt80000gn/T/launch4j3468360275998279553rc /var/folders/nf/cyskjq3n6qg696ydk9y6nrt80000gn/T/launch4j2382841914310125598o
    at net.sf.launch4j.Builder.build(Builder.java:146)
    at com.akathist.maven.plugins.launch4j.Launch4jMojo.execute(Launch4jMojo.java:367)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: net.sf.launch4j.ExecException: Exec failed (1): /Users/bourne/Workspace/maven_m2/net/sf/launch4j/launch4j/3.5.0/launch4j-3.5.0-workdir-mac/bin/windres --preprocessor=cat -J rc -O coff -F pe-i386 /var/folders/nf/cyskjq3n6qg696ydk9y6nrt80000gn/T/launch4j3468360275998279553rc /var/folders/nf/cyskjq3n6qg696ydk9y6nrt80000gn/T/launch4j2382841914310125598o
    at net.sf.launch4j.Util.exec(Util.java:156)
    at net.sf.launch4j.Cmd.exec(Builder.java:212)
    at net.sf.launch4j.Builder.build(Builder.java:96)
    ... 28 more

pom.xml

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>1.7.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                    <shadedClassifierName>shaded</shadedClassifierName>
                    <transformers>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            <mainClass>com.tools.hm.controller.TestMain</mainClass>
                        </transformer>
                    </transformers>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.akathist.maven.plugins.launch4j</groupId>
                <artifactId>launch4j-maven-plugin</artifactId>
                <version>1.7.2</version>
                <executions>
                    <execution>
                        <id>l4j-clui</id>
                        <phase>package</phase>
                        <goals>
                            <goal>launch4j</goal>
                        </goals>
                        <configuration>
                            <headerType>gui</headerType>
                            <jar>${project.build.directory}/${artifactId}-${version}.jar</jar>
                            <outfile>${project.build.directory}/test.exe</outfile>
                            <downloadUrl>http://java.com/download</downloadUrl>
                            <classPath>
                                <mainClass>com.tools.hm.controller.TestMain</mainClass>
                                <preCp>anything</preCp>
                            </classPath>
                            <icon>resources/2.icns</icon>
                            <jre>
                                <minVersion>1.7.0</minVersion>
                                <jdkPreference>preferJre</jdkPreference>
                            </jre>
                            <versionInfo>
                                <fileVersion>1.0.0.0</fileVersion>
                                <txtFileVersion>${project.version}</txtFileVersion>
                                <fileDescription>${project.name}</fileDescription>
                                <copyright>2012 hasCode.com</copyright>
                                <productVersion>1.0.0.0</productVersion>
                                <txtProductVersion>1.0.0.0</txtProductVersion>
                                <productName>${project.name}</productName>
                                <companyName>hasCode.com</companyName>
                                <internalName>hasCode</internalName>
                                <originalFilename>hasCode.exe</originalFilename>
                            </versionInfo>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
@hallooyo
Copy link
Author

hallooyo commented Jan 6, 2016

icon Configuration effects ,I can't find the icon path in my project.

@lukaszlenart
Copy link
Collaborator

icon Configuration effects ,I can't find the icon path in my project.

What does it mean? That the Launch4j plugin doesn't support defining path to icon?

@RockyMM
Copy link

RockyMM commented May 10, 2016

@hanforing You probably are seeing this problem: #4

@AntoCuc
Copy link

AntoCuc commented Sep 25, 2016

@hanforing I had a very similar issue and fixed it adding:

sudo: required
before_install:

  • sudo apt-get update -q
  • sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 -y

to my .travis.yml
see: https://github.com/AntoCuc/GpxSplitter/blob/master/.travis.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants