Possible Duplicate:
Can we run Java applictions on iPhone?
Does IPhone4 supports Java? Can we write any app using Java for IPhone?
You should check out Tabris which allows you to write Apps for iOS with Java. It does not have the "JVM on iOS Problem", as the Java Application runs on a server. On the device a native App is installed, which communicates with the server and renders the UI like any other native App. It's similar to a thin-client approach. There is NO cross-compiling and NO browser/html5 used for the mobile App.
No, the iPhone iOS does not have any built in support for Java.
Yes, you theoretically could write a Java app for the iPhone if you are expert enough to develop or port a JVM and suitable runtime to iOS, and embed those with your Java app inside an iOS app. Or you could develop a Java compiler that would emit ARM object code or Objective C source code and use that.
iPhoneFAQ Says:
No. The iPhone will not support Java applications of any kind. Steve Jobs has been quoted as saying "Java's not worth building in. Nobody uses Java anymore. It's this big heavyweight ball and chain."
and here is a post on iPhone development using javascript iAd Libararies: http://eclipsesource.com/blogs/2010/06/11/writing-ipadiphoneipod-applications-with-swt/
The problem with other languages is that iPhone apps aren't allowed to execute code from writable storage, which rules out any VMs. However, check out Monotouch - it compiles .NET code down to machine code (Ahead-Of-Time compiling) and is fully allowed by the app store (at the time of writing).
Additionally to answers above.
You can't to develop your own JVM for iPhone or other translator or virtual machine. It's prohibited by Apple. So if you really do this you can distribute it only via hacking of native iPhone software.
The iPhone has some limited support for Java on iOS available with a "jailbroken" device, through the Cydia store.
精彩评论