XML : Launch4j for jar to exe

Can't seem to figure out why I my JFileChooser never shows up when I run my .exe file created by launch4j. A lot of folks discuss mostly the class path on this error, but I'm failing to realize the solution.

Error:

  no main manifest attribute in C:\Users\Documents\...\HPLCData.exe    

Now if I change the class path to KFile.Main, then I get this error message

Error:

  Error: Could not find or locate main class KFile.class    

Admittedly, I'm rather new to java and maybe the answer is staring me in the face or is obvious, sorry if so. Otherwise, things I read point to an issue with the class path and I'm not entirely sure what I need to change.

Part of me wonders if it has something to do with the part in the xml file generated, but I have no idea what would go there. I've tried changing all kinda of strange things, the closest post I found had mentioned something about using the full class path. Or maaybe there is a problem with the jar wrapping, but I don't think so as I double checked this

Here are the .xml files generated by launch4j to wrap the .exe file.

case 1:

  <?xml version="1.0" encoding="UTF-8"?>  <launch4jConfig>    <dontWrapJar>false</dontWrapJar>    <headerType>console</headerType>    <jar>C:\Users\red\Documents\Java Modules\Introductory Files\HPLCData.jar</jar>    <outfile>C:\Users\red\Documents\Java Modules\Introductory Files\HPLCData.exe</outfile>    <errTitle></errTitle>    <cmdLine></cmdLine>    <chdir>.</chdir>    <priority>normal</priority>    <downloadUrl>http://java.com/download</downloadUrl>    <supportUrl></supportUrl>    <stayAlive>false</stayAlive>    <restartOnCrash>false</restartOnCrash>    <manifest></manifest>    <icon></icon>    <jre>      <path>C:\Users\red\Documents\Java Modules\Introductory Files\</path>      <bundledJre64Bit>false</bundledJre64Bit>      <bundledJreAsFallback>false</bundledJreAsFallback>      <minVersion>1.6.0_1</minVersion>      <maxVersion></maxVersion>      <jdkPreference>preferJre</jdkPreference>      <runtimeBits>64/32</runtimeBits>    </jre>    <versionInfo>      <fileVersion>1.0.0.0</fileVersion>      <txtFileVersion>version 1</txtFileVersion>      <fileDescription>Manage HPLC Data</fileDescription>      <copyright>Kemin 2016</copyright>      <productVersion>1.0.0.0</productVersion>      <txtProductVersion>version 1</txtProductVersion>      <productName>HPLC Data</productName>      <companyName>Red</companyName>      <internalName>Red</internalName>      <originalFilename>HPLCData.exe</originalFilename>    </versionInfo>  </launch4jConfig>    

Case 2:

  <?xml version="1.0" encoding="UTF-8"?>  <launch4jConfig>    <dontWrapJar>false</dontWrapJar>    <headerType>console</headerType>    <jar>C:\Users\red\Documents\Java Modules\Introductory Files\HPLCData.jar</jar>    <outfile>C:\Users\red\Documents\Java Modules\Introductory Files\HPLCData.exe</outfile>    <errTitle></errTitle>    <cmdLine></cmdLine>    <chdir>.</chdir>    <priority>normal</priority>    <downloadUrl>http://java.com/download</downloadUrl>    <supportUrl></supportUrl>    <stayAlive>false</stayAlive>    <restartOnCrash>false</restartOnCrash>    <manifest></manifest>    <icon></icon>    <classPath>      <mainClass>KFile.Main</mainClass>    </classPath>    <jre>      <path>C:\Users\red\Documents\Java Modules\Introductory Files\</path>      <bundledJre64Bit>false</bundledJre64Bit>      <bundledJreAsFallback>false</bundledJreAsFallback>      <minVersion>1.6.0_1</minVersion>      <maxVersion></maxVersion>      <jdkPreference>preferJre</jdkPreference>      <runtimeBits>64/32</runtimeBits>    </jre>    <versionInfo>      <fileVersion>1.0.0.0</fileVersion>      <txtFileVersion>version 1</txtFileVersion>      <fileDescription>Manage HPLC Data</fileDescription>      <copyright>Kemin 2016</copyright>      <productVersion>1.0.0.0</productVersion>      <txtProductVersion>version 1</txtProductVersion>      <productName>HPLC Data</productName>      <companyName>Red</companyName>      <internalName>Red</internalName>      <originalFilename>HPLCData.exe</originalFilename>    </versionInfo>  </launch4jConfig>    

No comments:

Post a Comment