Sun working on Java for the iPhone
Sun Microsystems is known for many things, but it is probably best known for Java. The promise of Java is that programmers can write an application once and run it on any machine, or device, that has a Java Virtual Machine (a virtual environment that runs on a computer which includes the Java runtime, so that the Java code can run). That's the promise of Java, sadly, the reality isn't always the same. Java Virtual Machines on different platforms often require special code (which kind of defeats the purpose) and most damning of all (especially on the Mac) is that Java has its own library of UI elements. Unless a Java programmer goes out of their way to make sure their app looks like a native app, it often has an unmistakable 'Java look' to it.
Sun now wants you to have all that Java fun on the iPhone. Shortly after the launch of the iPhone SDK, Sun started looking into the possibility of making a Java VM for the iPhone. After some investigating, they are sure that Java ME (that's the version of Java optimized for mobile devices) on the iPhone is possible and Sun wants to bring it to you. I'm sure there are many Java developers out there are very happy to hear this news.
Thanks, TJ.
Share
Sun Microsystems is known for many things, but it is probably best known for Java. The promise of Java is that programmers can write an...
Add a Comment
Apparently Jobs needs to be thought a lesson or two in benefits of Java over some other languages.
March 11 2008 at 6:08 AM Report abuse Permalink rate up rate down ReplyAnd my comment was meant as a reply to mark 2000's comment:
"Didn't Jobs say Java was a dead language? You know, along with reading..."
ARGHHHHHHHHH!
The amount of confusion / incorrect technical information in this thread is enough to make someone's head explode.
Okay, so, here's the deal: there's Java the language, Java the platform -- yes, Sun is to blame for some of the confusion there. But anyone who thinks you can directly compare things like Flash, Java, and Ajax simply doesn't understand what these things are FOR. Java does compete with Flash/Flex in the mobile space to the extent that they can both be used to create apps. But for anyone who says Java is "dead", ask the people running countless Java-based applications on Blackberries and other smartphones. In fact, the only device that doesn't is... iPhone.
As for performance, okay, first, Flash isn't a "language." ActionScript is a language. Second, the perceived slowness here is dependent on a HUGE number of variables -- how ambitious the task at hand is, what the available hardware is, how well the thing was coded, and what bottlenecks the platform itself (including the Java platform or Flash/Flex, whatever) create. There are quite a few things at which Java is very fast -- sometimes a lot faster than Flash -- but without specifics, it's impossible to make this kind of comparison. I see we're also perilously close to saying Java is an interpreted language. It's not. So that means any performance arguments made therein are, simply, wrong. Now, we can get into an in-depth discussion of how garbage collectors impact performance, but my bet is you don't want to go there.
Java is a tool, period. Often, a tool worth criticizing. But for the kneejerk people who want to blast anyone associated with the tool, I might remind you that there was a time fairly recently when Mac users were criticized by people in blanket statements by those with no real technical basis for their argument.
And unless the iPhone is going to be a complete island with separately-developed apps, Java could be absolutely essential to cross-platform developers for the many, many, many things not possible with HTML and Ajax.
1) As noted above, there's already a basic functioning Java VM and a very cool UIKit bridging library available for the jailbroken iPhone (using an open source VM and the GNU Classpath libraries). Check it out, and/or help out on the project. Just grab the Cydia installer and get going -- see http://www.saurik.com/id/1
2) Java done as an app would (A) have to be approved by Apple to be allowed on the iTunes store, and (B) could only be launched as a single generic icon from the home screen. This would need to launch a "Java Application Manager" or JAM like on some existing phones. Addressing one or both of these would be take some business-level cooperation between Apple and Sun, and they aren't exactly bosom buddies.
3) Unless the SDK exposes the hooks to use the on-chip Java acceleration, this is going to be off limits to Sun and anyone else. Which is a shame, really. Again, some business negotiations between Sun and Apple could help.
4) There's also a possibility of using an ahead-of-time Java compiler like gcj. There's definitely some work to be done to port this to arm-apple-darwin, but it would make binaries that do not need a virtual machine and thus wouldn't suffer any speed degradation.
Java on the Mobile is very powerful. JME is so well established. iPhone would definitely be a better with a JavaFX runtime.
Ok, so I definitely take my hat off to you as the first Flash-on-iPhone-sceptic who may actually know what he's talking about. :)
But do check out AS3. Personally I stick with Ye Anciente Actionscript because I'm too unreconstructed a programmer to handle any of this Java-like stuff. But AS3, and Tamarin, are deeply impressive. Flash has finally grown up.
Why you guys all hating on Java?
It's very easy to program for, has a large API, and last time I checked has the most developers.
>>As for your "optimised" comment, go Google 'Tamarin' and 'AVM2'. Adobe's virtual machine for AS3 produces super-fast ARM code. Just right for the iPhone.
Okay, the iPhone CPU includes native, hardware based Java acceleration. Maybe you should check your facts.
http://www.psynixis.com/blog/2007/07/02/iphone-has-hardware-java-acceleration/
http://www.engadget.com/2007/07/01/iphone-processor-found-620mhz-arm/
http://www.gearlog.com/2007/07/iphones_processor_samsung_s3c6.php
etc.
>>Flash isn't a language. Actionscript is a language. From the sound of it you've never seen Actionscript 3. AS3 is Java-like in many ways (as opposed to AS1, which was effectively JavaScript for Flash) but without being anywhere near as prissy as Java.
After 3 years of Flash, there are still many situations where I use Java (though not any where looks is the primary concern :P). You're right, I have yet to try AS3, but AS2 is definitely not Java-ish at all. It's completely different - semi-weak typing, imperative. And clearly you can do a hella lot more with Java than AS, the only thing Flash really has going is the interface.
And everyone I know calls Flash a programming language. AS is implied.
I'm gonna go check out AS3 right now. AS2 was definitely a step in the right direction, hopefully AS3 is even better.
I don't know how anyone can't see this as a good thing. First of all, having multiple ways to get apps on the phone is a plus. While there are an army of Mac devs ready to code up an iPhone app, they are a small contingent of developers. Second, there are already thousands of JavaME apps that will be available for the iPhone as soon as the implementation is deployed.
Say what you want about Java, but Java developers outnumber Obj-C developers by about 1000 to 1. You can bicker about the quality all day long, but I'd rather have a java app to perform a specific task, than no option at all.
And Java on Mac OS X doesn't use a different library of UI elements. They are Swing elements, just like on Windows and Linux. Each platform styles their elements differently to give the app as much of a "native" feel as possible. But if I code a Java Swing based app that has buttons, drop down menus, sliders, etc. - I don't have to do anything to that app to get it working on all platforms but compile it.
There are instances where you may have to tweak positioning to get your UI elements to look right across all three platforms, but after you've done development in Swing, you start to know where the cross platform pitfalls are. It's actually easier than getting CSS to look right between Firefox, Safari and IE6, that's for sure.
How wrong do you want to be in one comment?
Flash isn't a language. Actionscript is a language. From the sound of it you've never seen Actionscript 3. AS3 is Java-like in many ways (as opposed to AS1, which was effectively JavaScript for Flash) but without being anywhere near as prissy as Java.
As for your "optimised" comment, go Google 'Tamarin' and 'AVM2'. Adobe's virtual machine for AS3 produces super-fast ARM code. Just right for the iPhone.
But as ever with the Flash haters, much better to form your half-baked opinions from a few slow banner ads you've seen, eh?
As a user I'll always chose a native alternative. But given no other choice I'll definitely pick a J2ME app over nothing.
My company writes software for mobile phones. J2ME is indeed kind of a pain, not because of the language but because of the implementation: there are so much firmware bugs on every different device you can't count'em.
Now, given the market share of the iPhone (currently 0% legally in Switzerland), there's no chance I could get paid to write a native version of our apps for this platform. Currently our response to our customers who ask about an iPhone version is "Sorry, you have to get a 'normal' phone."
We didn't see any (compelling) advantage writing Symbian versions of our apps since the same phones already run java pretty well.
To sum it up I think the iPhone looks amazing and I'll definitely pick one myself if the price was reasonable. But if it doesn't run J2ME this means I'll miss out on a number of things. As always Apple is a bit pretentious in thinking every one out there will rewrite their applications in another language just for their phone.
Hot Apps on TUAW
Deals of the Day
more deals- JVC Motion Sensing Clock Radio with Dual iPod Docks for $55 + free shipping
- Apple iPhone Headset with Mic for $4 + $2 s&h
- miFrame Picture Frame Dock for iPad for $64 + $8 s&h
- Refurb Apple iPod nano 8GB MP3 Player for $99 + free shipping, 16GB for $119
- Hannspree Apple-Shaped 28" 1080p LCD HDTV for $270 + free shipping
- Philips wOOx Alarm Clock Radio for Apple iPod / iPhone for $60 + free shipping
Software Updates
more updates- EFI Firmware Update brings Lion Internet Recovery to 2010-model Macs
- OS X Lion 10.7.3 released with Safari 5.1.3, Wi-Fi bug fix
- Aperture updated to 3.2.2, addresses Photo Stream issue
- Apple updates Keynote to address Lion issues
- Google Search app gets new look on iPad
- Apple releases Apple TV Software Update 4.4.3



38 Comments