From: Wenjing Y. <wen...@gm...> - 2011-01-05 04:12:55
|
Hello everyone, I am new to XMLVM, but I am quite interested in its new C target. I checked out the latest version from repository, but there was an error when I used "ant" to compile the fresh version, as follows: [java] java.lang.ExceptionInInitializerError [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:194) [java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:771) [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221) [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135) [java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108) [java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) [java] at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ... ... ... Could you please tell me what is the problem here? Another question is that I can't find "java_lang_System.h" file in the subdirectory "src/xmlvm2c", where only has "java_lang_System.c". Where is the .h file? I can only find that "java_lang_System.h" is in "src/xmlvm2objc". My last question is whether the new C target is stable enough to be used? Thank you. -- *Best Regards Wenjing Yan* |
From: Arno P. <ar...@pu...> - 2011-01-05 06:05:06
|
here a little update on the C backend. If you check the repository you will notice that a lot of work has happened over the last couple of weeks. Overall the Java to C language cross-compiler is much more complete than the existing Objective-C backend. To answer one of your questions: I believe the C backend is quite usable! One thing that is missing are the Cocoa wrappers, so while you can generate C code, you can't really use it for developing iOS applications yet. But we are working on it and hope to make fast progress. To answer your question about java_lang_System.h: for the Objective-C backend we require hand-written versions of J2SE classes such as java.lang.System. For the C backend, we simply cross-compile OpenJDK to C! This gives us *much* better coverage compared to the Objective-C backend. If you want to give it a little spin, try this: - check out the latest version of XMLVM in Eclipse (the ant script is not yet up-to-date and we rely on Eclipse to compile certain parts of XMLVM). - In a shell, do the following: cd trunk/xmlvm ant # This will cross-compile ReflectionTest.java plus all # dependent J2SE classes to directory 'out' java -Xmx508m -jar dist/xmlvm.jar --target=c --exp-load-deps \ --dep-optimization-config=lib/redlist.txt \ --in=bin/org/xmlvm/test/ReflectionTest.class \ --in=bin-util/ --out=out cp src/xmlvm2c/compat-lib/java/* out mv out/xmlvm.m out/xmlvm.c gcc -std=c99 -w -DXMLVM_NO_GC out/*.c ./a.out Note that the 'out' directory contains all static dependencies from J2SE that were automatically cross-compiled from OpenJDK (over 700 classes!). As the first of the XMLVM demos, you can use the C backend to cross-compile iFireworks: cd demo/iphone/ifireworks ant cd - java -Xmx500m -jar dist/xmlvm.jar --target=iphone-c \ --app-name=iFireworks --exp-load-deps \ --dep-optimization-config=lib/redlist.txt \ --resource=demo/iphone/ifireworks/res/ \ --in=demo/iphone/ifireworks/build/classes/ \ --in=bin-util/ --out=out1 open out1/dist/iFireworks.xcodeproj Note that we generate portable C code. ReflectionTest can be compiled anywhere you have a C compiler because it is a simple console application. The iFireworks demo is iOS specific and requires Xcode. I think the C backend will prove to be of huge benefit: more efficient code, better J2SE coverage, and last but not least, a proper garbage collector. We will keep you guys posted on our progress. Arno On 1/4/11 8:12 PM, Wenjing Yan wrote: > Hello everyone, > > I am new to XMLVM, but I am quite interested in its new C target. > > I checked out the latest version from repository, but there was an error > when I used "ant" to compile the fresh version, as follows: > > [java] java.lang.ExceptionInInitializerError > [java] at > org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:194) > [java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:771) > [java] at > org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221) > [java] at > org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135) > [java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108) > [java] at > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) > [java] at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) > [java] at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > ... ... ... > > Could you please tell me what is the problem here? > > Another question is that I can't find "java_lang_System.h" file in the > subdirectory "src/xmlvm2c", where only has "java_lang_System.c". Where > is the .h file? I can only find that "java_lang_System.h" is in > "src/xmlvm2objc". > > My last question is whether the new C target is stable enough to be used? > > Thank you. > > -- > /Best Regards > Wenjing Yan/ > > > > ------------------------------------------------------------------------------ > Learn how Oracle Real Application Clusters (RAC) One Node allows customers > to consolidate database storage, standardize their database environment, and, > should the need arise, upgrade to a full multi-node Oracle RAC database > without downtime or disruption > http://p.sf.net/sfu/oracle-sfdevnl > > > > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users |