-2

Possible Duplicate:
Can we run Java applictions on iPhone?

im not sure this is the place for asking this but ill give it a go anyway.

i recently downloaded MobileTerminal on my iPhone 4.3.3 and it got me thinking. iOS is basically a pretty version of linux.

what if i was to download the Java Binary files to my iphone and set the path enviroment to point to it? will i have java capabillities this way on my iphone? or will there something else that wont let me compile java?

i wanted to run this issue past here maybe someonw has any experience with it before i start messing around with my phone.

thanks :)

Community
  • 1
  • 1
Eli
  • 181
  • 1
  • 3
  • 10
  • 2
    and you want to run ugly Java Swing apps on your pretty iPhone? – irreputable Jun 23 '11 at 20:11
  • 6
    "iOS is basically a pretty version of linux" <- this is wrong. – yan Jun 23 '11 at 20:13
  • @yan right, actually it's a version of OS X which is Unix (BSD to be specific) – Chris Thompson Jun 23 '11 at 20:15
  • @irreputable, you can just call native code (or bridge cocoa), if apple were more apt to allow that; but java on iphone will cut their profits off app store. I always feel for the iphone developers when they have to port from java, while android is basically run and have fun. – bestsss Jun 23 '11 at 22:05
  • @yan, yeah, it's not even pretty :) – bestsss Jun 23 '11 at 22:09
  • @bestsss - Actually, the major blocking point is the security model on the iPhone would largely require that each app to install the Java stack all over again. Like all Apple APIs, iOS is user and not developer centric. – TechZen Jun 23 '11 at 22:37
  • @TechZen, sure, no access outside the application domain. I'd gladly install a small VM and not port to objective-c [it can be just C and that's a true saving grace] (gladly it's not me who ports but when the *** hits the fan, I have to look into the code). Memory management is just in the butt once you get used to a GC (and memory management in multi-threaded set-up is no cake in the park) – bestsss Jun 23 '11 at 22:43
  • Corey, yes my iphone is jailbroken... – Eli Jun 24 '11 at 09:21
  • so you dont recomend developing for iphone with java? – Eli Jun 24 '11 at 09:22
  • @Eli, if you intend to distribute the application via app store then your application is not going to get approved. something in this line. – bestsss Jun 25 '11 at 09:28

6 Answers6

0

The Java binaries would need to work with iOS, especially the iOS UI to be useful. So it would only work with the standard Java Binaries in a limited capacity. There may be projects out there trying to accomplish this, but there is not a full port of Java UI concepts at this time from what I know.

FYI JamVM seems to be one of the Java virtual machines that the Cydia guys have packaged. http://iphoneroot.com/tutorial-install-java-on-the-iphone/

ricosrealm
  • 1,616
  • 1
  • 16
  • 26
0

You'll need a Java runtime for iOS, which as far as I know, doesn't exist.

Steve Kuo
  • 61,876
  • 75
  • 195
  • 257
0

It is against the App Store rules to run a JVM on an iPhone (no interpreted code). Therefore you cannot run Java programs on an iPhone.

The best bet to do so is to use MonoTouch (commercial software) which allow you to develop in .NET and deploy to an iPhone.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
0

For the sake of an actual answer: if your phone is jailbroken, go read here:

http://geeknizer.com/how-to-install-compile-run-java-apps-on-iphone/

You can certainly run Java on iOS...but you're going to need to be jailbroken to do it.

If you don't want to or can't jailbreak, you're out of luck.

lxt
  • 31,146
  • 5
  • 78
  • 83
  • i'v seen this tutorial...for some reason i cant find the iPhone/Java package their talking about even though i have all the sources. any ideas? wouldnt installing the regular java for linux work? – Eli Jun 24 '11 at 09:26
0

Assuming you haven't jailbroken your phone, you can't run Java on it. If you have jailbroken it, take a look at http://iphoneroot.com/tutorial-install-java-on-the-iphone/.

John Percival Hackworth
  • 11,395
  • 2
  • 29
  • 38
  • i'v seen this tutorial...for some reason i cant find the iPhone/Java package their talking about even though i have all the sources. any ideas? wouldnt installing the regular java for linux work? – Eli Jun 24 '11 at 09:26
0

Running Java on your iDevice is soooo much more complicated than it may initially seem. True, iOS is simply a different UI on top of the OS X operating system. However, it's compiled for a completely different instruction set with likely a number of changes made due to the hardware requirements. So, for starters, getting the JVM binaries running on your iDevice would be nontrivial (would require you to recompile them for the appropriate processor) and would require significant modification to the UI components to work with the screen resolution and drawing paradigms of iOS.

In short, this is a much more complicated process than it seems. Let me put it this way, you'd have a much easier time writing a compiler that translates Java bytecode to native iOS code than you would trying to get a JVM up and running on it....

Chris Thompson
  • 35,167
  • 12
  • 80
  • 109