JavaFX on iOS w/OpenJDK Mobile?

Bob Vandette bob.vandette at oracle.com
Mon Apr 4 11:52:06 UTC 2016


> On Apr 3, 2016, at 2:07 PM, cerebra soft <cerebrasoft at gmail.com> wrote:
> 
> Hello all,
> 
> Great work on the mobile port of the JDK.  With some work I've been able to
> successfully build the JDK and launch it in the iOS simulator and on an iOS
> device.  I used the RunJava Xcode project and haven't attempted to use the
> Java Launcher framework yet.
> 
> I see from the mobile project page that currently the goal is headless
> support up to compact2 profile.  But of course I want more. ;)
> 
> I see that OpenJDK JavaFX builds are working on iOS using the RoboVM based
> compiler and the Android Dalvik runtime.  With the recent purchase of
> Xamarin by Microsoft the future of RoboVM is uncertain.  Also Android
> itself is moving to OpenJDK instead of remaining on Dalvik.  So the future
> of JavaFX on iOS via RoboVM is unsure for multiple reasons.
> 
> How far out would you guess (and I understand it would probably be a guess)
> would it be for the mobile project to support full JRE functionality on
> iOS? Is it a matter of just trying to build JavaFX on top of what the Java
> Mobile project already has, or would that be a fools errand?
It depends what you mean by a full JRE.

We’ve limited our focus to the modules contained in the compact2 profile specification
since it provides adequate support for a wide variety of mobile applications, can
support Java FX apps and it’s the set of packages used by our MAF (Mobile Applications
Framework product).  Limiting the Java support also provides a smaller application
binary size.

If you rule out Headful support , the work required to support the rest of the JDK 9 modules
isn’t really that bad since most of it is java code.  It is possible to provide a compliant 
implementation that is validated in headless mode.  The bulk of the remaining work involves 
validating and adapting the few remaining native libraries to iOS & Android where the testing
is probably the largest effort.

> 
> Presuming that may be far off and a great deal of work.  What options are
> there for using the mobile JRE on the 'back end' of the application and
> making the 'ui' in something else?
That’s what I assume you’d use JavaFX for, right?  We have no desire to
provide a Swing/AWT implementation for mobile platforms.

>  I'd love to keep as much of my
> application logic in Java across platforms.  Primarily, I think I would
> need a good way of calling into the JVM from the UI layer.  I'm somewhat
> familiar with JNI and abstractions like JNA.  Would those work just as well
> with the mobile JRE on iOS?
Yes, JNI is fully supported on iOS.  You do need to build native libraries as static
libs since iOS doesn’t support dynamic shared libraries but this is supported by
the JNI specification.

Bob.

> 
> Thanks,
> Rob



More information about the mobile-dev mailing list