launch4j to an exe file. Here is my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>InsertMySQL</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.45</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.mycompany.insertmysql.insert</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<id>l4j-gui</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>gui</headerType>
<outfile>target/Project.exe</outfile>
<jar>target/InsertMySQL-1.0-SNAPSHOT.jar</jar>
<!-- if <dontWrapJar>true</dontWrapJar> change to this conf <jar>${project.artifactId}-${project.version}.jar</jar> -->
<dontWrapJar>false</dontWrapJar>
<errTitle>Error in launch4j plugin</errTitle>
<classPath>
<mainClass>com.mycompany.insertmysql.insert</mainClass>
</classPath>
<jre>
<minVersion>1.7.0</minVersion>
<maxVersion>1.9.0</maxVersion>
<initialHeapSize>512</initialHeapSize>
<maxHeapSize>1024</maxHeapSize>
</jre>
<versionInfo>
<fileVersion>1.0.0.0</fileVersion>
<txtFileVersion>1.0.0.0</txtFileVersion>
<fileDescription>des</fileDescription>
<copyright>Copyright (c) 2014 </copyright>
<companyName>comp</companyName>
<productVersion>3.0.0.0</productVersion>
<txtProductVersion>${project.version}</txtProductVersion>
<productName>Project</productName>
<internalName>Project</internalName>
<originalFilename>Project.exe</originalFilename>
</versionInfo>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
above is my POM.xml
Question
when double click on project.exe , nothing is executed.nothing is appear.nothing happen after execute the project.exe
anything wrong at this code??
what i have missed? still need to install anything or what? is yes, please step by step guide me, thx =)
UPDATE
after i had run the cmd java -cp C:\Users\chiny\Desktop\InsertMySQL\target\InsertMySQL-1.0-SNAPSHOT.jar com.mycompany.insertmysql.insert
to solve java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
so, i had searched the solution, just mention to add the dependency, as you can see, my pom.xml is attached with dependency mysql connector already. i have no idea how to solve it
UPDATE 2
how about i get this error? what is this?
ALL THE PROBLEM IS the CLASSPATH, java can't find the mysql-connector-java.jar path. how to solve it?
but when i m runing with java -cp .;C:\Users\chiny\.m2\repository\mysql\mysql-connector-java\5.1.45\mysql-connector-java-5.1.45.jar;C:\Users\chiny\Desktop\InsertMySQL\target\InsertMySQL-1.0-SNAPSHOT.jar com.mycompany.insertmysql.insert
with mysql-connector-java-5.1.45.jar
then the project.exe able to run..how to set the nysql connector classpath in programmatically ?