Skip to content

Cross-compiling Java to Objective-C for the iPhone

It seems that you can cross compile Java to Objective-C on the iPhone. I didn’t dig any deeper than that.

Here is the blurb for the technologies used:

The goal of XMLVM is to offer a flexible and extensible cross-compiler toolchain. Instead of cross-compiling on a source code level, XMLVM cross-compiles byte code instructions from Sun Microsystem’s virtual machine and Microsoft’s Common Language Runtime. The benefit of this approach is that byte code instructions are easier to cross-compile and the difficult parsing of a high-level programming language is left to a regular compiler. In XMLVM, byte code-based programs are represented as XML documents. This allows manipulation and translation of XMLVM-based programs using advanced XML technologies such as XSLT, XQuery, and XPath.

Apple’s iPhone has generated huge interest amongst users and developers alike. Like MacOS X, the iPhone development environment is based on Objective-C as the development language and Cocoa for the GUI library. The iPhone SDK license agreement does not permit the development of a virtual machine. Using XMLVM, we circumvent this problem by cross-compiling Java to the iPhone. Just like a Java application can be cross-compiled to AJAX, XMLVM can be used to cross-compile a Java application to Objective-C. The cross-compilation is also accomplished by mimicking a stack-based machine in Objective-C. Consider the instruction (integer remainder) that pops two integers off the stack and pushes their remainder after division back onto the stack. Using the following XSL template, the instruction can be mapped to Objective-C.

(via the PLT Mailing List)

9 Comments

  1. natureman wrote:

    im used iphone sdk3.0,if help me and thank u very much….

    Sunday, August 9, 2009 at 08:35 | Permalink
  2. natureman wrote:

    i use the iphone sdk 3.0 on ipod touch 1G

    Sunday, August 9, 2009 at 08:45 | Permalink
  3. Grant wrote:

    Natureman:
    Are you looking for help, or did the post help you?

    Sunday, August 9, 2009 at 09:45 | Permalink
  4. natureman wrote:

    Thank u for replay,i will java to iphone,the gesture can convert too? and your soft or sdk free or not? 谢谢!

    Tuesday, August 11, 2009 at 08:19 | Permalink
  5. Grant wrote:

    Hi Natureman:
    You should investigate that on the XMLVM website itself.

    Please let me know how it works for you :).

    Tuesday, August 11, 2009 at 08:30 | Permalink
  6. frank ginett wrote:

    Are you aware of third party consultants willing to convert a Java app to iPhone
    for a fee?

    Tuesday, December 1, 2009 at 13:51 | Permalink
  7. faisal wrote:

    there is no web account now
    i am working on a small iphone project on ijava and i want to ask if i can use the GUI jpanel

    Monday, September 20, 2010 at 23:56 | Permalink
  8. faisal wrote:

    i want to see how can i convert java to objective c using xmlvm plz somebody reply at my email
    faisal_ns_dr@hotmail.com

    Tuesday, September 21, 2010 at 05:25 | Permalink
  9. pranab wrote:

    I have posted an issue of missing library with the list: could you respond to the same?

    Thursday, April 5, 2012 at 06:37 | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*