Does iphone SDK support java application?

Discussion in 'Mac Programming' started by credit1, Apr 20, 2008.

  1. credit1 macrumors newbie

    Joined:
    Apr 1, 2008
    #1
    I am wondering if iphone can run a java application?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    The iPhone does not have a JDK. Applications must be written using Objective-C.
     
  3. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #3
    more important than a JDK, the iPhone has no JVM. It seems like if Apple gets its way, it will not. Sun said they would produce one, but there is a clause in Apple's guidelines that forbids programs that run other programs, interpret code/scripts, etc.

    It would be nice to have a JDK just for the iPhone that provided access to native GUI controls and access to the hardware without devs having to make their own JNI to C/Objective-C bridge. It just seems unlikely.

    -Lee
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Sorry. Pre-coffee reply. I meant JVM, not JDK.
     
  5. Monkaaay macrumors 6502

    Monkaaay

    Joined:
    Jun 19, 2006
    Location:
    Richmond, VA
    #5
    As others have said, no. I wouldn't expect to see one either. If you have an understanding of Java I would say picking up Objective-C would be pretty easy.
     
  6. Sayer macrumors 6502a

    Sayer

    Joined:
    Jan 4, 2002
    Location:
    Austin, TX
    #6
    Java's JVM would put additional stress on a limited hardware platform.

    Phones don't run the full java platform, they run a scaled down version called BREW (Binary Runtime Environment for Wireless). iPhone is NOT a full platform analogous to a laptop or desktop. Its a mobile device, very limited RAM and processing power (due to literal battery power limits).

    Since the iPhone is already limited in its UI and feature set, it doesn't make sense to try and shoe-horn an existing Java app onto the iPhone. Just make a new iPhone-specific version of your client app using Cocoa Touch.

    BTW there are tons of existing Mac developers who wouldn't mind making an iPhone app in places like RentACoder.com.
     
  7. cube macrumors G5

    Joined:
    May 10, 2004
  8. psychofreak Retired

    psychofreak

    Joined:
    May 16, 2006
    Location:
    London
    #8
    [​IMG]

    iPhone has no Java. Palm has Java. Palm=Loser in market share.
     
  9. credit1 thread starter macrumors newbie

    Joined:
    Apr 1, 2008
    #9
    Are you sure it supports BREW? If if supports, then it should support the java application obeying BREW protocol same as on other mobile phone. That should be a good news.

     
  10. cube macrumors G5

    Joined:
    May 10, 2004
    #10
    I don't care about the primitive US phone market. There are a lot companies with J2ME applications for phones, not just smartphones.
     
  11. credit1 thread starter macrumors newbie

    Joined:
    Apr 1, 2008
    #11
    Yes, I am thinking develop the J2ME application with limited modification and run on almost every mobile phones. Just wonder if iphone really support any kind of j2me/j2se program. Then programmer's life will be much easier.
     
  12. cube macrumors G5

    Joined:
    May 10, 2004
  13. rendezvouscp macrumors 68000

    Joined:
    Aug 20, 2003
    Location:
    Long Beach, California
    #13
    This is a bit comical (sorry it’s at your expense). Read what he said again (emphasis mine).

    I do the same thing sometimes. :)
     
  14. cube macrumors G5

    Joined:
    May 10, 2004
    #14
    BREW is a Qualcomm thing. The usual stuff in Phones is J2ME (restricted Java platform).
     
  15. yeroen macrumors 6502a

    yeroen

    Joined:
    Mar 8, 2007
    Location:
    Cambridge, MA
    #15
    Java == loser programmers :)
     
  16. Sbrocket macrumors 65816

    Sbrocket

    Joined:
    Jun 3, 2007
    Location:
    /dev/null
    #16
    While I wouldn't go that far even though I don't favor Java anymore (after using it for several years myself), you're wasting your time trying to get a Java application to work on the iPhone - J2ME or not.
     
  17. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #17
    There has been some confusion, so I will state again:
    There is NO java on the iPhone. No BREW, no j2me, no j2se, none. There is no JVM, and the likelihood of there ever being one can only be based on whether you believe Sun or Apple.

    Since Apple has a pretty firm grip on the official platform, I am betting on Apple's past remarks holding true. As such, I don't believe there will ever be Java on the iPhone.

    If there was it would make the *Java* programmer's life much easier. HTML/Javascript and Objective-C/Cocoa are not more difficult than Java, but if Java is all you know and you don't wish to learn anything else, then you are in a tough spot in terms of iPhone development.

    I don't think this needs to be as contentious as it has become. Java is a valid language, as is Objective-C. The Java community is larger at the moment, but NeXTSTEP and Apple have championed Objective-C and the iPhone is Apple's baby.

    Should it be "open"? That's another thread (and probably forum) entirely, and there is a community dedicated to unlocking the iPhone so you can run whatever you want on it. To access the hardware you still have to use Objective-C to make the calls, but using a jailbroken (etc.) phone, you could write bridges for other languages and program in them.

    If you did choose to port a current Java program to Objective-C you could probably easily have it running on full OS X as well as the iPhone and iPod Touch. This may be of no interest whatsoever, but it might be a positive side effect.

    -Lee
     

Share This Page