OpenJDK on Android

2 views
Skip to first unread message

Fernando Cassia

unread,
Oct 27, 2012, 1:07:00 AM10/27/12
to dis...@openjdk.java.net
Why isn´t there a OpenJDK for Android? Would it be too difficult to port?.
License restrictions on the part of Google to include third party runtimes?

In short, has anyone attempted to build a OpenJDK for Android? What are the
technical hurdles, if any?

FC

Andrew Hughes

unread,
Nov 13, 2012, 12:21:06 PM11/13/12
to Fernando Cassia, dis...@openjdk.java.net
Lack of an ARM port? Don't most Android devices run on ARM?
--
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07

LaMothe, Ryan R

unread,
Nov 13, 2012, 2:50:09 PM11/13/12
to Andrew Hughes, Fernando Cassia, dis...@openjdk.java.net
Of even more interest, I think, is why Google chose to use Apache Harmony
instead of OpenJDK in the first placeŠ


__________________________________________________

Ryan LaMothe

Geir Magnusson Jr.

unread,
Nov 13, 2012, 3:19:37 PM11/13/12
to LaMothe, Ryan R, dis...@openjdk.java.net
the lack of GPL for starters as well as the fact that Harmony was first :)

Fernando Cassia

unread,
Nov 13, 2012, 5:03:13 PM11/13/12
to LaMothe, Ryan R, dis...@openjdk.java.net
On Tue, Nov 13, 2012 at 4:50 PM, LaMothe, Ryan R <Ryan.L...@pnnl.gov>wrote:

> Of even more interest, I think, is why Google chose to use Apache Harmony
> instead of OpenJDK in the first place
>

That is history. I´m not interested in history and history of corporations´
political decisions. I´m interested in knowing what technical hurdles are
there that prevent OpenJDK from running atop Android (if any). Let´s move
forward.

There are pretty good ARM ports of OpenJDK already, so what´s missing?.
What prevents someone from building "OpenJDK for Android/ARM" and offering
it for download so that those who want to run Java SE apps atop Android can
do it?.

FC

Fernando Cassia

unread,
Nov 13, 2012, 11:38:30 PM11/13/12
to Paul_...@infoworld.com, dis...@openjdk.java.net
On Tue, Nov 13, 2012 at 9:51 PM, <Paul_...@infoworld.com> wrote:

> This is Paul Krill, a reporter for InfoWorld. What is the deal with
> OpenJDK on Android? I take it there is no version of OpenJDK for Android
> now. What would be the benefit?
>

Huh? Run the thousands of Pure-Java apps out there without "converting"
them to Android apps?.

For an Infoworld reporter, you seem to lack the understanding of
cross-platform Java bytecode apps (compiled Java SE apps) with Android
apps, which, while written in the Java language, run only on Android.

What Google has done with Android is break the 3 advantages of Java, and
restrict it to being only a programming language.

Java is actually three things:

-A programming language
-A runtime environment (JVM)
-A level playing field software ecosystem.

Android as an OS uses Java only as #1 out of 3. Apps written "for Android"
run only ON ANDROID, as they require the Dvlik VM and associated APIs.

In effect, what Google did with Java and Davlik was "embrace and extend"
just like Microsoft tried to do with "Microsoft Java" in the 1990s.

FC

Andrew Haley

unread,
Nov 14, 2012, 4:21:21 AM11/14/12
to Fernando Cassia, dis...@openjdk.java.net, LaMothe, Ryan R
On 11/13/2012 10:03 PM, Fernando Cassia wrote:
> There are pretty good ARM ports of OpenJDK already, so what´s missing?.
> What prevents someone from building "OpenJDK for Android/ARM" and offering
> it for download so that those who want to run Java SE apps atop Android can
> do it?.

I don't know of any technical reason. I don't know that anyone
has tried.

Andrew.

Mario Torre

unread,
Nov 14, 2012, 5:57:50 AM11/14/12
to Andrew Haley, dis...@openjdk.java.net, LaMothe, Ryan R
In fact, it's not even that difficult.

Android is basically Linux, you would need to replace the graphics stack
(Cacio to the rescue!) and do some minor fix here and there.

Last year at FOSDEM Xerxes Randby demoed NetBeans on a Nokia phone, I would
expect an Android port to be very similar.

For this to work, you likely need a rooted device though.

An alternative would be to add Swing support to the core Android, you
should be able to reuse most of the OpenJDK or Classpath code for that (I
did something similar once, it's not so much work as it seems), and this is
the approach taken by most companies to offer Java ME compatibility.

Finally, you can do something like our WebJDK (part of Caciocavallo again),
and render stuff into an HTML 5 container (we tested this on Android 2.2,
so any new Android is far better).

To be honest, the likely reason nobody tried those things *for real* is
that I don't think it really makes much sense to run desktop applications
on such small devices (even if they are actually capable of doing so).

The embedded world is full of custom solutions and those will keep existing
for year, in my eyes those are the ones that would benefit for such a port
to exist, but it's usually all about specialized applications that run in
very specific and controlled environments. Those are mostly covered already
(embedded Linux, Maemo, and so on, but also Window CE and QNX, VXWorks,
OS9, just to name a few, there is really no lack of Hardware and Software,
and they cost less than an Android phone) and probably moving those
programs (even if they could work directly) is usually very expensive
(beside, there may be support issues here, which is at times more important
than the flexibility to chose the Hardware/Software platform).

Writing full applications for Android (or iOS for that matter) is usually a
simpler task than doing a port of existing code, and perform better, and
now JavaFX is coming to a maturity, so also supporting this as a new cross
platform Toolkit is an option.

Probably this situation is going to change with ARM64 approaching, then I
see a scenario where the remote app with local HTML 5 rendering is in a
very good position, but so far it seems nobody is really interested in
investing any money to make those port a reality.

Overall, I'm not an analyst so what I wrote may be completely untrue, but I
guess this kind of things are really dedicated to a very small niche market.

This is a possible explanation of the "why nobody is doing it" question you
asked, but again, I may be completely off here :)

Cheers,
Mario


2012/11/14 Andrew Haley <a...@redhat.com>
--
pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA FC7C 4086 63E3 80F2 40CF

IcedRobot: www.icedrobot.org
Proud GNU Classpath developer: http://www.classpath.org/
Read About us at: http://planet.classpath.org
OpenJDK: http://openjdk.java.net/projects/caciocavallo/

Please, support open standards:
http://endsoftpatents.org/

Fernando Cassia

unread,
Nov 14, 2012, 6:51:24 AM11/14/12
to Mario Torre, dis...@openjdk.java.net
On Wed, Nov 14, 2012 at 7:57 AM, Mario Torre <neugens.li...@gmail.com
> wrote:

> To be honest, the likely reason nobody tried those things *for real* is
> that I don't think it really makes much sense to run desktop applications
> on such small devices (even if they are actually capable of doing so).


Android only on phones? Two years ago perhaps.
Today, Android is increasingly on large-screen TVs...
http://goo.gl/iWx0z

If you ask me, the right way to disrupt Google´s disruption of the Java
ecosystem (pardon the redundancy) is to build the whole Android APIs atop
the JVM...

I wish this project had more momentum...

http://www.icedrobot.org/

---

IcedRobot is an attempt to bring the Android API on Linux Desktop.
(...)
2. Avoid Dalvik and Harmony as much as possible and put the Android stack
on top of the OpenJDK class library, and run the whole thing in Hotspot
(this is cool, ins’t it?).
---

But wtf do I know. ;-)

FC

Mario Torre

unread,
Nov 14, 2012, 7:22:56 AM11/14/12
to Fernando Cassia, dis...@openjdk.java.net
Eh, I wish we had some more developers than just myself :)

Daneel, the Dalvik-to-Java converter is basically done, though, it works
quite well (that was a different story than the rest of the project, it was
all quite fast and got lots of contributions).

For the rest I did quite some good things, but really, this is not a one
man job, the API is huge, and it requires lots of low level work,
especially for the Insets stuff.

It's fun thing to work on, though, perhaps when I either get some spare
time (or my manager manages to propose the new 48hours day ISO standard! :)
*or* we get more people interested, I could reboot it, I'm always
interested in this project.

Cheers,
Mario


2012/11/14 Fernando Cassia <fca...@gmail.com>

Andrew Haley

unread,
Nov 14, 2012, 8:34:42 AM11/14/12
to Fernando Cassia, dis...@openjdk.java.net
On 11/14/2012 11:51 AM, Fernando Cassia wrote:
> On Wed, Nov 14, 2012 at 7:57 AM, Mario Torre <neugens.li...@gmail.com
>> wrote:
>
>> To be honest, the likely reason nobody tried those things *for real* is
>> that I don't think it really makes much sense to run desktop applications
>> on such small devices (even if they are actually capable of doing so).
>
>
> Android only on phones? Two years ago perhaps.
> Today, Android is increasingly on large-screen TVs...
> http://goo.gl/iWx0z
>
> If you ask me, the right way to disrupt Google´s disruption of the Java
> ecosystem (pardon the redundancy) is to build the whole Android APIs atop
> the JVM...

Well, that's excellent. Are you going to start work on it?

Andrew.

Mario Torre

unread,
Nov 15, 2012, 4:21:36 AM11/15/12
to Fernando Cassia, dis...@openjdk.java.net
2012/11/14 Mario Torre <neugens.li...@gmail.com>


> especially for the Insets stuff.
>
^^^^^^^^^

That meant to be "Intents" [1] obviously :)

Cheers,
Mario

[1] http://developer.android.com/reference/android/content/Intent.html

Fernando Cassia

unread,
Nov 26, 2012, 9:06:02 PM11/26/12
to dis...@openjdk.java.net
On Wed, Nov 14, 2012 at 9:22 AM, Mario Torre <neugens.li...@gmail.com
> wrote:

> It's fun thing to work on, though, perhaps when I either get some spare
> time (or my manager manages to propose the new 48hours day ISO standard! :)
> *or* we get more people interested, I could reboot it, I'm always
> interested in this project.
>
> Cheers,
>

And so Infoworld´s Paul Krill, who lurks on this list, used this thread to
write this FUD piece.

http://www.infoworld.com/d/application-development/open-source-java-android-dont-bet-it-207457?page=0,1

I guess there´s an unwritten rule in IT journalism these days where one if
barred from saying anything positive about Java and OpenJDK these days that
doesn´t fit the "Google will rule the world, Oracle and Java, bad" myopic
point of view.

Surely reads like a mix of wishful thinking and self-fulfilling prophecy...
discourage anyone even toying with the idea from actually doing it...

FC

--
During times of Universal Deceit, telling the truth becomes a revolutionary
act
- George Orwell
Reply all
Reply to author
Forward
0 new messages