zeromq / jzmq

Java binding for ZeroMQ
http://www.zeromq.org
GNU General Public License v3.0
590 stars 363 forks source link

jzmq and Java ME 8.2 #398

Open mdrescher opened 8 years ago

mdrescher commented 8 years ago

Hi all,

I really do like ZeroMQ, and jzmq.

So far, I have been able to run it on various platforms, i.e. Ubuntu 14.04, as well as my Raspberry Pi Model B Rev. 2 using Oracle Java8 SDK. Runs smooth, and even quite performant, too.

However, I am in a bit of a catch-22 situation as I would like to use ZeroMQ together with the Raspberry Pi's devices (GPIO, PWM, SPI, I2C etc) - but:

I haven't found a way - at least for the development stage - to add the device I/O to my Java 8 installation on the Raspi.

Hence I am asking whether jzmq can be ported to JavaME? I could do some code reviews etc. but I am not a native lib developer, so I wouldn't be of any help here...

Cheers, Michel

sjohnr commented 8 years ago

I am not a native lib developer, so I wouldn't be of any help here

Nor am I really. But what classes aren't available? Could you be more specific?

trevorbernard commented 8 years ago

@mdrescher, I don't believe JZMQ will be supporting Java ME anytime soon or even at all. It is quite an undertaking since Java ME is a subset of Java SE prior to 1.5. E.g. Java ME doesn't include generics which are widely used in JZMQ. Another approach for accessing the Pi's hardware would be to use a language such as python/ruby/c to access GPIO, etc, and communicate with the java process over ZeroMQ.

Though if you were to create a Java ME fork, we'd be more than happy to host it under zeromq.

mdrescher commented 8 years ago

Hi,

Sorry for answering late.

Since mid-2015 Java ME 8 (latest version is 8.2) supports all language features of Java 8 - I.e. including genetics and all other bells and whistles.

Except for certain functionality such as - on top of my head - Java NIO and bespoke filesystem I/O which jzmq is using, Java ME is pretty much complete for embedded devices - plus some more, so it is not a strict subset of Java SE (never had been IMHO).

However, I eventually managed to include Java Device I/O in my current Java SE environment on my Raspi, so I can use both (0MQ and Device I/O) at the same time, which I wanted.

Next step is to try out Java SE Embedded (provides three successively more restricted footprint profiles of SE) and see whether that works. At first glance neither profiles seem to miss out on functionality required by Jana.

Cheers, Michel On 27 Dec 2015 22:16, "Trevor Bernard" notifications@github.com wrote:

Closed #398 https://github.com/zeromq/jzmq/issues/398.

— Reply to this email directly or view it on GitHub https://github.com/zeromq/jzmq/issues/398#event-501002524.

trevorbernard commented 8 years ago

I look forward to your findings/patches :)

mdrescher commented 8 years ago

Hi Trevor, all,

The first result is in: jzmq is apparently compliant with Java SE Embedded profile "compact1" (the smallest, with a memory footprint of only 11 MB!)

For others to confirm, here's what I did: 1) Device: Raspberry Pi B Rev 2 (not used, but will be in later stages) 2) Install Java SE 8.2 Update 62 JDK(!) on the device 3) Install libsodium 1.0.7 as described 4) Install ZeroMQ 4.1.4 as described 5) Install JZMQ as described 6) Check that we are on the right device, and use Oracle's JDK tool "jdeps" to analyse tependencies and applicable profile:

michel@raspberrypi:~ $ cat /proc/cpuinfo processor : 0 model name : ARMv6-compatible processor rev 7 (v6l) BogoMIPS : 2.00 Features : half thumb fastmult vfp edsp java tls CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xb76 CPU revision : 7

Hardware : BCM2708 Revision : 000e Serial : 000000007407ec0b michel@raspberrypi:~ $ /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/bin/jdeps -P /usr/local/share/java/zmq.jar /usr/local/share/java/zmq.jar -> /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/rt.jar (compact1) org.zeromq (zmq.jar) -> java.io compact1 -> java.lang compact1 -> java.net compact1 -> java.nio compact1 -> java.nio.channels compact1 -> java.nio.charset compact1 -> java.util compact1 -> java.util.concurrent compact1 -> java.util.concurrent.atomic compact1 -> java.util.jar compact1 michel@raspberrypi:~ $

Now I would need something that would allow me to quickly confirm this by running a (desirably) complete feature test of jzmq to make sure that its dependencies are also met at runtime.

If someone can provide me with such tool, I'd be most grateful as I am only at the beginning of using ZeroMQ :-)

Cheers, Michel

On 28 December 2015 at 00:04, Trevor Bernard notifications@github.com wrote:

I look forward to your findings/patches :)

— Reply to this email directly or view it on GitHub https://github.com/zeromq/jzmq/issues/398#issuecomment-167449463.