From: Markus N. <mar...@gm...> - 2012-09-05 16:39:20
|
Hi John, Several issues with what you are trying to achieve: 1. For the out of memory exception just add increase the heap space of the vm like this: java -Xmx 2G -jar xmlvm.jar --in=/HelloWorld.class --target=iphone --iphone-app=TheApplication 2. If you want to cross-compile to the iPhone you can't just simply use a Java program with a main method as entry point but you will have to extend UIApplicationDelegate instead. Check out the tutorial under http://xmlvm.org/tutorial/ which steps you through creating a simple HelloWorld and also includes a ton of other example apps Cheers, Markus On Wed, Sep 5, 2012 at 8:47 AM, John Tan <joh...@ho...>wrote: > Dear Arno, > I am having problems trying to compile a my HelloWorld.class file to > Objective C code. > > The Java code that I generate my class file with is as shown below: > > public class HelloWorld { > > public void HelloWorld() { > System.out.println ("Hello World!"); > } > } > > In my Mac OS Terminal, I type: > > java -jar xmlvm.jar --in=/HelloWorld.class --target=iphone > --iphone-app=TheApplication > > (xmlvm.jar file has been generated.) > > However I get this compilation error message: > > Exception in thread "main" java.lang.OutOfMemoryError: Java heap space > at java.util.Arrays.copyOf(Arrays.java:2786) > at > java.io.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:133) > at > com.simontuffs.onejar.JarClassLoader.alreadyCached(JarClassLoader.java:796) > at com.simontuffs.onejar.JarClassLoader.loadBytes(JarClassLoader.java:509) > at > com.simontuffs.onejar.JarClassLoader.loadByteCode(JarClassLoader.java:455) > at > com.simontuffs.onejar.JarClassLoader.loadByteCode(JarClassLoader.java:446) > at com.simontuffs.onejar.JarClassLoader.load(JarClassLoader.java:386) > at com.simontuffs.onejar.JarClassLoader.load(JarClassLoader.java:276) > at com.simontuffs.onejar.Boot.run(Boot.java:282) > at com.simontuffs.onejar.Boot.main(Boot.java:159) > > Please advise. > > Thank you very much for your kind efforts, > > Cheers, > John > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > > |