DISQUS

VinodLive: Core Java on iPhone

  • David Herron · 2 years ago
    JamVM is JSE 1.5 compatible. Not true.. the pages you reference make no claim of JavaSE Compatibility, and say over and over that they've ported only a subset of the java.* classes so therefore it cannot be Java Compatible.
  • Vinod Ponmanadiyil · 2 years ago
    Thanks David. I have made the corrections. Jay's project page though states about 1.5 core classes. I need to verify the version compatibility more further.
  • Vinod Ponmanadiyil · 2 years ago
    The port apparently IS capable of running JSE 1.5 command line applications.
  • David Herron · 2 years ago
    Thank you for your correction. Perhaps my vision on this is blinded a little by working inside the Java SE team. To us the word 'Compatible' when said like 'Java Compatible' means that it has passed the testing which allows for certification.. namely, the Java TCK (JCK). Doing some adhoc testing like "it runs a few commands" is like saying "this code 'works' for some definition of 'works'". I own an iPod Touch and would love to have Java on the thing. But in my role as a Java SE team member I'm very interested in knowing that when something claims to be 'Java' that it really is 'Java'.
  • Techblissonline Dot Com · 2 years ago
    so when will we java apps on iphone?
  • Vinod Ponmanadiyil · 2 years ago
    Please note that this is not J2ME. So your old games etc still wont work.
  • Robert Lougher · 2 years ago
    Regarding compatibility. It is using JamVM 1.5.0 with GNU Classpath 0.96.1.

    JamVM 1.5.0 implements the publically available Java Virtual Machine Specification Second Edition, and the JNI specification, including additions up to JDK 1.5.

    GNU Classpath 0.96.1 aims for 100% compatibility with JDK 1.5 but it isn't complete. Its API compatibility is tested by Japitools, and the results are publically available:

    Against JDK 1.4 (92.63%) :

    http://www.kaffe.org/~stuart/japi/htmlout/h-jdk...

    Against JDK 1.5 (88.33%) :

    http://www.kaffe.org/~stuart/japi/htmlout/h-jdk...

    However, neither JamVM or GNU Classpath has been tested against, let alone passed, the Java Compatibility Kit (JCK). This is required for certification and to be "Java Compatible".

    Having said that, Sun have not made the JCK available to open-source projects so it's hardly surprising that they haven't been tested against it.

    With the release of OpenJDK, Sun have announced a new license for the JCK (OpenJDK Community TCK license):

    http://www.infoq.com/news/2007/08/openjdk-jck

    However, to qualify for access to the compatibility tests the project must be "substantially derived" from the OpenJDK itself. This means the JamVM/GNU Classpath combination would still not be able to be tested as both are clean-room implementations and are in no way derived from OpenJDK.
  • Robert Lougher · 2 years ago
    I should also add that in the absence of the JCK, the open-source community has been working on Mauve. This is a collaborative effort to write a free test suite for the Java™ class libraries :

    http://sources.redhat.com/mauve/

    JamVM and GNU Classpath are regularly ran against Mauve. The results can be found on comp.java.classpath.testresults :

    http://news.gmane.org/gmane.comp.java.classpath...

    Or directly from GNU Classpath's official autobuilder and regression tester:

    http://builder.classpath.org/
  • David Herron · 2 years ago
    Yes, Robert, I agree the situation as it stands is not ideal.
  • Jay Freeman (saurik) · 2 years ago
    The answer to when you can run Java applications on your iPhone is immediately, and for the last week or two ;P.

    If you add the repository http://apptapp.saurik.com/ to Installer.app and install a bunch of stuff you will be able to write _graphical_ applications for your iPhone in either Java or JavaScript (thanks to Rhino, and some extra work I put in to JocStrap).

    There are also a couple example applications in there: HelloJava and HelloScript. Both include their source code so you can see how they work.

    If anyone needs help, send me an e-mail; my contact info is on my website. I also hang out on #iphone on irc.saurik.com, if anyone wants to come and ask questions.

    There will probably be a separate website soon for my JocStrap project, and some tutorials of how to write applications now that development isn't so hectic ;P.
  • Jay Freeman (saurik) · 2 years ago
    Oh, just to be more clear: you can write "native" iPhone applications in Java/JavaScript, as in, that work exactly like built-in applications and operate on the same library. This is due to my JocStrap library, that connects Java to Objective-C.

    If anyone needs more support than what JocStrap currently provides (which is a number of frameworks including WebKit, Celestial, and UIKit), I'd be happy to either activate it or fix it. ;P