Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch4j doesn't work (main class not found)

Tags:

java

launch4j

I am using Launch4j to create an setup file. I have 7 classes, under a package. And JavaSamp is my main class. I have created jar files for all the classes. And my launch4j looks like this:

 <launch4jConfig>
  <dontWrapJar>true</dontWrapJar>
  <headerType>gui</headerType>
  <jar></jar>
  <outfile>install\Piratechx.exe</outfile>
  <errTitle></errTitle>
  <cmdLine></cmdLine>
  <chdir>.</chdir>
  <priority>normal</priority>
  <downloadUrl>http://java.com/download</downloadUrl>
  <supportUrl></supportUrl>
  <customProcName>true</customProcName>
  <stayAlive>false</stayAlive>
  <manifest></manifest>
  <icon></icon>
  <classPath>
    <mainClass>JavaSamp</mainClass>
    <cp>lib/JavaSamp.jar</cp>
    <cp>lib/DataBaseHelper.jar</cp>
    <cp>lib/JavaDemo.jar</cp>
    <cp>lib/FileEncryption.jar</cp>
    <cp>lib/SendEmail.jar</cp>
    <cp>lib/WriterHelper</cp>
  </classPath>
  <jre>
    <path>jre6</path>
    <minVersion></minVersion>
    <maxVersion></maxVersion>
    <jdkPreference>jreOnly</jdkPreference>
  </jre>
  <versionInfo>
    <fileVersion>1.0.0.0</fileVersion>
    <txtFileVersion>1.0</txtFileVersion>
    <fileDescription>Piratechx</fileDescription>
    <copyright>Copyright (c) 2007 FSP</copyright>
    <productVersion>1.0.0.0</productVersion>
    <txtProductVersion>1.0</txtProductVersion>
    <productName>Piratechx</productName>
    <companyName>FSP</companyName>
    <internalName>Piratechx</internalName>
    <originalFilename>Piratechx.exe</originalFilename>
  </versionInfo>
 </launch4jConfig>

Any suggestion pls...

like image 356
Manikandan Avatar asked Oct 10 '22 19:10

Manikandan


1 Answers

You can't just define JavaSamp as main class. If it is in a seperate namespace or something (which it probably is considering you are using multiple jars) you would need to declare the full 'proper' name

like image 172
Vincent Koeman Avatar answered Nov 02 '22 09:11

Vincent Koeman