2014-12-03 35 views
0

我已经从Eclipse 4.4 Luna中导出了一个jar(非可执行文件),并试图使用JWrapper为Windows,OSX和Linux生成本机应用程序。我在终端所用的命令是致命错误使用JWrapper构建Java应用程序

My-MacBook-Pro-:JWrapper me$ java -Xmx512m -jar jwrapper-00031607960.jar SpaceInvaders/InvadersGame.jar 

文件系统是为这样:

File system for Java Build

和XML文件jwrapper-spaceinvaders.xml如下:

<!-- The name of the app bundle --> 
<BundleName>SpaceInvaders</BundleName> 

<!-- The specification for one app within the bundle --> 
<App> 
    <Name>SpaceInvaders</Name> 
    <LogoPNG>SpaceInvaders/logo.png</LogoPNG> 
    <MainClass>InvadersGame</MainClass> 
</App> 

<SupportedLanguages>en</SupportedLanguages> 

<!-- App is a per-user app, it won't elevate and install for all users and the shared config folder will be per-user --> 
<InstallType>CurrentUser</InstallType> 

<!-- Splash and Logo --> 
<BundleLogoPNG>SpaceInvaders/logo.png</BundleLogoPNG> 

<!-- JVM options (e.g. extra memory) --> 
<JvmOptions> 
<JvmOption>-Xmx256m</JvmOption> 
</JvmOptions> 

<!-- The JREs JWrapper should use for Windows, Linux32, Linux64... --> 
<Windows32JRE>JRE-1.7/win32/jre1.7.0_05</Windows32JRE> 
<Windows64JRE>JRE-1.7/win32/jre1.7.0_05</Windows64JRE> 
<Linux32JRE>JRE-1.7/linux/jre1.7.0_13</Linux32JRE> 
<Linux64JRE>JRE-1.7/linuxx64/jre1.7.0_13</Linux64JRE> 
<Mac64JRE>JRE-1.7/macos64/jre1.7.0_45.jre</Mac64JRE> 

<!-- The files that the app wants to bundle, here we have just one which is a JAR file and we specify that it should be on the launch classpath --> 
<File classpath='yes'>SpaceInvaders/InvadersGame.jar</File> 

,但我得到使用上面的命令试图从终端打造的时候出现以下错误:

JWrapper 00031607960 
Resources not found (wrappers+lib), will extract jwrapper-00031607960.jar.. 
JWrapperCompiler started 
JWrapper is performing a full build... 

[Config] Building file is SpaceInvaders/InvadersGame.jar 
[Updates] Checking for updates... 
[Fatal Error] :1:1: Content is not allowed in prolog. 
********************************** 
*   BUILD FAILED   * 
********************************** 
** Reason: (see stacktrace below) 

org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. 
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257) 
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347) 
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121) 
    at jwrapper.JWrapperCompiler.main(JWrapperCompiler.java:563) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:606) 
    at SecureRunner2.<init>(SecureRunner2.java:464) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
    at SecureRunner1.<init>(SecureRunner1.java:422) 
    at SecureRunner1.<init>(SecureRunner1.java:227) 
    at SecureRunner1.main(SecureRunner1.java:52) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:606) 
    at jwrapper.launch.JWCompiler.main(JWCompiler.java:112) 

如果也许我的JAR文件没有被正确建立由Eclipse中,因为样本应用程序似乎是我想知道建立好,我只是修改了基于给定示例的XML文件。

+0

可能重复的[的SAXParseException:内容不允许在序言](HTTP:/ /stackoverflow.com/questions/20551572/saxparseexception-content-is-not-allowed-in-prolog) – A4L 2014-12-03 18:56:25

+0

这是无效的XML! XML应该只有一个根,并且不能以评论开头。 – A4L 2014-12-03 18:57:49

+0

这不是问题,问题是第一个命令实际上并没有调用XML文件。这是JWrapper读取的正确格式。 – admrply 2014-12-03 19:01:50

回答

0

在终端所输入的命令是不正确的,最后一部分应该给路径.xml文件,而不是.jar文件

相关问题