1

我第一次使用launch4j,我得到一个编译错误。我已将 jre 文件夹复制到文件夹“C:\Users\8xy2ms\Desktop\smsModel\smsModel”。

这是错误代码:

Compiling resources
Generated resource file...
LANGUAGE 0, 1
1 RCDATA BEGIN ".\\jre6\0" END
18 RCDATA BEGIN "1\0" END
21 RCDATA BEGIN "http://java.com/download\0" END
20 RCDATA BEGIN "32\0" END
101 RCDATA BEGIN "An error occurred while starting the application.\0" END
102 RCDATA BEGIN "This application was configured to use a bundled Java Runtime Environment but the runtime is missing or corrupted.\0" END
103 RCDATA BEGIN "This application requires a Java Runtime Environment\0" END
104 RCDATA BEGIN "The registry refers to a nonexistent Java Runtime Environment installation or the runtime is corrupted.\0" END
17 RCDATA BEGIN "true\0" END

这是项目xml

<launch4jConfig>
  <dontWrapJar>false</dontWrapJar> 
  <headerType>gui</headerType> 
  <jar>C:\Users\8xy2ms\Desktop\smsModel\smsModel\test2.jar</jar> 
  <outfile>C:\Users\8xy2ms\Desktop\smsModel\smsModel\test.exe</outfile> 
  <errTitle /> 
  <cmdLine /> 
  <chdir /> 
  <priority>normal</priority> 
  <downloadUrl>http://java.com/download</downloadUrl> 
  <supportUrl /> 
  <customProcName>false</customProcName> 
  <stayAlive>false</stayAlive> 
  <manifest /> 
  <icon /> 
  <jre>
  <path>./jre6</path> 
  <minVersion /> 
  <maxVersion /> 
  <jdkPreference>preferJre</jdkPreference> 
  </jre>
  </launch4jConfig>
4

2 回答 2

0

就我而言,我在其中使用了额外的选项。取消它们,它很快就会对你有用。只选择那些是强制性的。

于 2017-03-10T20:08:41.410 回答
0

我知道这是一个非常古老的问题,但今天发生在我身上,谷歌把我带到了这里......

我的问题是路径分隔符。必须使用 '' 而不是 '/'。所以正确的是:<path>.\jre6</path>

于 2020-10-13T18:14:28.360 回答