6 ms·
The reason why Google went with writing their own version of Java has nothing to do with avoiding the GPL and everything to do with avoiding to have to pay mone
by zak_mc_kracken 11y ago
The reason why Google went with writing their own version of Java has nothing to do with avoiding the GPL and everything to do with avoiding to have to pay money to Sun.
- pron 11y agoWell, they had two options: license Sun's Java or do as they please with the GPLed OpenJDK. If they'd chosen the latter they wouldn't have needed to pay a dime. Sun/Oracle place no restrictions in addition to the GPL itself when it comes to OpenJDK (in fact, the GPL explicitly prohibits any such further restrictions). You can do as you will with it.
- wstrange 11y agoMy understanding was that Sun (and now Oracle) had "field of use" restrictions on the JDK that prohibited it being used on mobile devices without buying a license. I am not sure how enforceable those restrictions were, but I imagine that factored into the decision to use the Apache JDK project
- pron 11y agoThat was before OpenJDK. There are a few ways you can license Java. You may freely implement it yourself, but then you must pass the TCK and abide by Oracle's field-of-use restrictions, you may negotiate a license from Oracle (Sun at the time) for their source code and use of the technology, or you can do whatever you like with OpenJDK (although to use the Java trademark you probably need to conform to some other requirements)[1]. BTW, Oracle/Sun's JDK is OpenJDK with a few advanced monitoring/profiling add-ons. In any case, OpenJDK was released in May 2007, and Android unveiled in November later that year and made available only a year later. The reason Google used Apache Harmony was because they couldn't reach a licensing agreement with Sun and chose not to use OpenJDK because of its GPL license, believing phone vendors would reject it. As Google probably wanted to have a non-standard edition of Java, it's unlikely that Sun would have licensed it to them (or they would have required a new standard being formalized first). Their best option was to use OpenJDK, but they didn't. They wrote their own runtime -- which, to this day, is at a great performance disadvantage compared to OpenJDK -- suffers annoying incompatibilities and is a few Java versions behind, all in order to not use GPL software. Was Google right in thinking that phone manufacturers not have put up with GPL? I'm sure that at the time that's what the phone makers told them. Perhaps Android wouldn't have taken off if they had tried to shove the GPL down their throats. But I believe that with the iPhone breathing down their necks and no better alternative, the phone vendors would have yielded. We would have ended up not only with a much better, faster, more compatible Android, but with the most ubiquitous operating system on the planet being truly free. This also would have prevented the Oracle-Google lawsuit. Instead, we're left with a slow OS that's years behind embedded Java, not truly open (as closed-source modifications are made by vendors), and a legal battle that some believe may have far-reaching consequences. All because people are afraid of the GPL. [1]: For example, I believe (though I'm not sure) that IBM's and Aicas's JDKs follow the first choice (maybe the second), Azul's Zing JVM the second, and Azul's Zulu the third.
- rdsnsca 11y agoYou do know the court case on that is stone ongoing? Google won round one..... Lost round two on appeal .... And is now appealing the lose.
- zak_mc_kracken 11y ago> They wrote their own runtime -- which, to this day, is at a great performance disadvantage compared to OpenJDK This is completely incorrect. OpenJDK is absolutely not optimized for mobile and it would have been a disaster on mobile. A lot of the Dalvik runtime and libraries have been rewritten with performance and memory in mind.
- pron 11y agoSome public benchmarks are old, but they were done after Dalvik had gotten its JIT (both runtimes have seen huge improvement since), and after it had been "optimized for mobile": https://blogs.oracle.com/javaseembedded/entry/how_does_android_22s_performance_stack_up_against_java_se_embedded https://blogs.oracle.com/javaseembedded/entry/how_does_andro... You are right that Dalvik was written to be optimized for mobile, but you have to understand compared to what. Dalvik is optimized for mobile compared to simple VMs that don't have a lot of work put into them -- not compared to HotSpot. Java's embedded versions have had a lot more effort put into them than Dalvik. Dalvik itself was plan B for Google, after they'd failed to secure a licensing deal with Sun (and didn't want OpenJDK's GPL). It wasn't anyone's first choice, and certainly wasn't some new powerful technology. Just a VM that was good enough compared to the effort that's been put into it. There are open source (obviously) OpenJDK distributions[1] specifically made for embedded devices (although you can build them yourself), and (proprietary) editions of Java have been running on devices as constrained as SIM cards for much longer than Android exists. [1]: http://www.azulsystems.com/products/zulu-embedded http://www.azulsystems.com/products/zulu-embedded
- zak_mc_kracken 11y agoYou are glossing over the fact that Dalvik is a multiprocess VM. There is no such JVM, even today. This aspect and the Dalvik bytecode are the main reasons why Dalvik is so fast on mobile. No other VM (or JVM) can realistically compete, especially not HotSpot. Not now and certainly not back then.
- deleted 11y ago[deleted]
- rdsnsca 11y agoWell Sun and Goggle are still in court fighting over that.
- pron 11y agoYes, but if Google had not been afraid of the GPL, there would have been no need for that fight. OpenJDK is licensed under GPL plain-and-simple. Google could have done whatever they pleased with that code (and would have had far less work to do, and would have had a more modern and performant runtime).
- zak_mc_kracken 11y ago> Yes, but if Google had not been afraid of the GPL, there would have been no need for that fight. If Android had been using the GPL, it would probably never have taken off because: - Manufacturers and other partners would have refused to use it - OpenJDK is not optimized for mobile, so performance would have been disastrous (especially in 2007, try to remember the kind of phones we were using back then)