简体   繁体   English

Launch4j 不起作用(未找到主 class)

[英]Launch4j doesn't work (main class not found)

I am using Launch4j to create an setup file.我正在使用 Launch4j 创建一个安装文件。 I have 7 classes, under a package.我有 7 个班级,在 package 下。 And JavaSamp is my main class. JavaSamp 是我的主要 class。 I have created jar files for all the classes.我为所有类创建了 jar 文件。 And my launch4j looks like this:我的 launch4j 看起来像这样:

 <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...任何建议请...

You can't just define JavaSamp as main class.您不能只将 JavaSamp 定义为主 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如果它在单独的命名空间或其他东西中(它可能正在考虑您正在使用多个 jar),则需要声明完整的“正确”名称

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM