We have moved to a new Sailfish OS Forum. Please start new discussions there.
15

JVM to Sailfish

asked 2014-01-16 22:08:12 +0300

Upp15 gravatar image

updated 2014-01-19 19:13:42 +0300

nephros gravatar image

Is there any reason, why there wouldn't/couldn't/shouldn't exist a tailored implementation of Java (ME?) for Sailfish?

Security comes probably first to everybodys mind. However, the vast majority of Java's security problems are browser (Java plugin) related. Here I'm talking about stand alone Java applications in a "Linux computer", which are no more insecure, than any C++ app.

Performance could be another argument. In PC world JIT/HotSpot enabled JVMs are almost as fast executing as traditionally compiled C/C++ code (they say, that in many cases even faster...). I'm not that aware, what is the situation in mobile world, but since Android apps are sort of Java apps, I suppose the performance is not a problem there either?

The point would be to get huge increase to the number of potential developers to make more applications for Sailfish powered devices. Of course this would require, that all the necessary Sailfish APIs and libraries would be provided for the JVM. I leave to experts to estimate, how hard could that be.

:-)

edit retag flag offensive close delete

Comments

It might be possible. The JavaSE 7 for ARM does work on the Nokia N9 - I even had full Netbeans IDE running on the N9, albeit very slowly :) However, I guess it is written for X windowing system, which is absent on Jolla. But you'd need libraries to interface with the middleware and Silica, which would deviate considerably from standard Java stuff. Perhaps QtQuick binding to JVM could help.

Fuzzillogic ( 2014-01-16 22:45:34 +0300 )edit

Java is faster than C. What kind of sorcery is this?

cropas ( 2014-01-17 01:27:43 +0300 )edit

Personally I have zero interest in having a Java VM on my Jolla. If it should become available than for sure it should be an optional install. But I think Jolla / the community can spend their limited resources in better ways.

Winfried ( 2014-01-17 16:31:17 +0300 )edit

Would this decrease the burden to port Android apps to Sailfish?

AnaT ( 2014-01-19 12:04:36 +0300 )edit

@Fuzzlogic that would be exactly what I'm aiming for here. Don't they have JavaSE 7 for ARM in Raspberry Pi ?

Upp15 ( 2014-01-31 09:06:56 +0300 )edit

5 Answers

Sort by » oldest newest most voted
3

answered 2014-01-16 22:49:56 +0300

Ballock gravatar image

I don't see much use in this. Java ME seems so, well, dated. Although there used to be a couple of applications for Java ME, I believe those were of some use up to Symbian, where the screen is smallish, and you would interact with it with some sort of keyboard. I guess the same would go for any type of desktop-only and/or Java SE applications.

As for writing new applications in Java that would use the Qt UI, I guess the case is open. See http://qt-project.org/wiki/Category:LanguageBindings which lists the bindings to other programming languages, I heard people urge for Python, which AFAIK not yet accepted for Harbour (but apps run fairly well), but there's some Java bindings too. I guess you can try that if you're interested.

edit flag offensive delete publish link more

Comments

2

python should come very soon afaik, thanks to the work of thp :)

kelvan ( 2014-01-16 23:35:08 +0300 )edit

And i confirm python apps works really well : ownNotes available on openRepos.net ;)

Khertan ( 2014-01-17 18:54:05 +0300 )edit

I'm not actually talking about JavaME here. E..g. for Raspberry Pi (which is Arm based, I believe) they write JavaFX apps, which is totally different world.

Upp15 ( 2014-01-31 09:04:28 +0300 )edit
3

answered 2014-01-17 14:45:56 +0300

xranby gravatar image

updated 2014-01-17 14:47:38 +0300

The JogAmp community is working on making JVM and Java technology accessible on mobile devices inside the Ji Gong project. http://jogamp.org/wiki/index.php/Ji_Gong_Overview The Ji Gong goal is to make it easy to deploy JVM technology using free software on mobile and embedded devices. Ji Gong will enhance and re-purpose existing technology such as OpenJDK and IcedTea-web for use on mobile systems.

High performance can be archived on mobile and embedded systems by utilitizing all the specialized DSP/GPU units. It is possible to access DSP/GPU by providing an Java application direct access the native window. By using the native window it is possible to accessing the GPU by using hardware accelerated API's such as OpenGL, OpenVG and OpenMAX, the pre-requirement is to have access to the native window. High performance compute may be possible using OpenCL if drivers are available. In the future there will be more standardized cross platform API's for realtime image recognition and we better make sure that these API's are accessible for Java. JogAmp JOGL can today access the native window in a platform independent way using the NEWT windowing toolkit, this is known to work on the Nokia N9 phone, NEWT can be extended to initializing the native window using wayland for hardware accelerated rendering using sailfishOS and wayland.

edit flag offensive delete publish link more

Comments

Nice description of a full JVM stack! I am a bit confused though what component/steps are missing (and what is usable) today on Sailfish. What works / is in progress / is missing in the three things you talk about:

1) Ji Gong deploys JVM on Sailfish (sort of "app store technology" that must be installed on Jolla)?

2) IcedTea-Web builds against OpenJDK and Wayland?

3) The NEWT extension gives native window to JVM / JOGL via Wayland?

Any estimates on how much work/time is needed?

cake3d ( 2014-04-10 15:17:28 +0300 )edit

A: 1. deploy OpenJDK with your application, a compact profile of OpenJDK 8 is currently ~30mb we have some build scripts that creates the JRE http://jogamp.org/git/?p=jigong/jigong.git;a=commit;h=a94b0e3c62110f077ea391ccdc158b2c804a5bb8 2. we patch IcedTea-Web to only use NEWT for windows and i/o and call this applet3. demo Fosdem 2014 https://jogamp.org/doc/fosdem2014/ 3. Wayland NEWT support is a work-item https://jogamp.org/wiki/index.php/SW_Tracking_Report_Objectives_for_the_release_2.2.0

xranby ( 2014-04-10 18:00:47 +0300 )edit

You replace AWT by Applet3. So AWT and Swing API, which are part of OpenJDK, cannot be used in your solution, right? And what about JavaFX?

More constructive question maybe is what widgets (GUI toolkit) do you suggest to use with NEWT?

cake3d ( 2014-04-12 02:26:11 +0300 )edit
3

answered 2014-04-10 15:54:51 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2014-04-10 15:58:41 +0300

cake3d gravatar image

Oracle's Embedded JDK8 binary product for ARMv7 Linux (VFP, HardFP ABI, Little Endian) just work for headless apps on Sailfish, but GUI apps need X11 and will crash with the Wayland display server used by Sailfish.

No GUI is a show-stopper for many, but it can be still useful if you make GUI using other technology, or if your application does not need GUI at all.

You can download a complete JVM8 package http://grifinor.net/data/jre8-hflt-fx.zip that worked on our Jolla after uploading it to the phone, and unpacking it from Jolla's terminal app.

edit flag offensive delete publish link more
1

answered 2019-07-27 21:22:43 +0300

ds1979 gravatar image

Are there any news in the meantime?

edit flag offensive delete publish link more
0

answered 2014-04-10 17:21:17 +0300

Plnt gravatar image

I didn't tried it on Android nor on Alien Dalvik on Jolla but maybe these tools can help (at least as a workaround for running J2ME applications on Jolla).

http://w3epic.com/run-java-apps-j2me-on-android-devices-guide/

http://davy.preuveneers.be/phoneme/?q=node/28

edit flag offensive delete publish link more

Comments

Worth mentioning is also application "J2ME Loader". It is available on both Google Play and F-Droid. It is open source, still developed and works well with more recent Android versions as well (as opposite to mentioned two applications). https://github.com/nikita36078/J2ME-Loader

mp107__ ( 2019-07-29 11:09:09 +0300 )edit
Login/Signup to Answer

Question tools

Follow
10 followers

Stats

Asked: 2014-01-16 22:08:12 +0300

Seen: 3,922 times

Last updated: Jul 27 '19