I have exported a jar (non-executable) from Eclipse 4.4 Luna as shown and have tried to use JWrapper to produce native apps for Windows, OSX and Linux. The command I used in terminal was
My-MacBook-Pro-:JWrapper me$ java -Xmx512m -jar jwrapper-00031607960.jar SpaceInvaders/InvadersGame.jar
the file system is as such:
and the xml file jwrapper-spaceinvaders.xml
is as follows:
<!-- 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>
But I get the following error when trying to build from terminal using the above command:
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)
I'm wondering if maybe my JAR file isn't being built correctly by Eclipse because the sample app seems to build fine and I just modified the xml file based on the sample given.