digiPixel
Posts: 7
Joined: Mon Nov 16, 2015 7:55 pm

Java ME Embedded Runtime For Raspberry Pi 2 Model B

Mon Nov 16, 2015 8:10 pm

Trying to get a simple Java ME Embedded program (of the Hello World variety) running on the Raspberry Pi 2 Model B however an error appears saying the platform isn't supported. In Device Manager the Raspberry Pi is recognised however the platform information displayed is incorrect (Raspberry Pi Model B).

Is there going to be an updated Java ME Embedded runtime released very shortly to support the Raspberry Pi 2 Model B :?:

digiPixel
Posts: 7
Joined: Mon Nov 16, 2015 7:55 pm

Re: Java ME Embedded Runtime For Raspberry Pi 2 Model B

Tue Nov 17, 2015 2:26 am

Below is the output after running installMidlet.sh on the Raspberry Pi:

Java is starting. Press Ctrl-C to exit
detect_fb_type: unknown device type
[ERROR] [LCD] iso=-1:javacall_init_frame_buffer: failed to detect fb type
[CRITICAL] [PROXY] iso=-1:Can't create server
can not connect to device manager
[ERROR] [AMS] iso=0:The MIDlet suite could not be run.

detect_fb_type: unknown device type
Not sure if unknown device type refers to the JRE failing to detect the platform that it is running on.

User avatar
DougieLawson
Posts: 39303
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Java ME Embedded Runtime For Raspberry Pi 2 Model B

Tue Nov 17, 2015 9:05 am

What's "Java ME"? Why not use the full-blown Oracle Java SDK v7 or v8?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

digiPixel
Posts: 7
Joined: Mon Nov 16, 2015 7:55 pm

Re: Java ME Embedded Runtime For Raspberry Pi 2 Model B

Tue Nov 17, 2015 9:44 pm

Need low level hardware access. Hence the need for Java ME (Micro Edition) Embedded. Java SE doesn't have a low level hardware access API.

User avatar
DougieLawson
Posts: 39303
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Java ME Embedded Runtime For Raspberry Pi 2 Model B

Tue Nov 17, 2015 9:49 pm

What sort of hardware access?
pi4j (a java wrapper round wiringPi) gives you complete control of the GPIO pins.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

digiPixel
Posts: 7
Joined: Mon Nov 16, 2015 7:55 pm

Re: Java ME Embedded Runtime For Raspberry Pi 2 Model B

Tue Nov 17, 2015 10:10 pm

Currently need access to GPIO at the moment. Just discovered that there is an option to add the Device I/O library (based on the same API found in Java ME Embedded) to Java SE Embedded, which would be easier than using pi4j since it isn't part of the standard Java APIs.

There is an excellent article covering the Device I/O API with a Raspberry Pi. Provides good insight into getting started with the Device I/O API.

cmalai
Posts: 4
Joined: Thu Nov 26, 2015 3:14 am

Re: Java ME Embedded Runtime For Raspberry Pi 2 Model B

Fri Nov 27, 2015 6:33 am

Why didnt you try PI4J ? A very userfriendly Java Library for RaspberryPI. www.pi4j.com

You should try out CodeRASPIDe. This is an IDE under Development for RaspberryPI.

CodeRASPIde is our small contribution to the IoT and Java Eclipse Community.
This IDE is ment for Beginners and is based on PI4J libraries. You design and it generates the required code.
Visit : http://www.ancitconsulting.com/coderaspide/index.html

Features Included

Project Wizard for Creating a new PI4J Project
Java Project with PI4J Library added to ClassPath
Configuration File for RasberryPI Programming with extn .picfg
Modeling Editor for Editing the RasberryPI Model
PIN Status Diagram indicating the USE of the PINs
Zest based Code Visualizer to represent the current Flow Diagram
Remote Execution and Debug from Eclipse on RasberryPI using LaunchPI Plugins

Currently Supports 40PIN based RaspberryPI Boards
RaspberryPI A+
RaspberryPI B+
RaspberryPI 2

- See more at: https://marketplace.eclipse.org/content ... spberry-pi

mdrescher
Posts: 1
Joined: Wed Dec 23, 2015 6:48 pm

Re: Java ME Embedded Runtime For Raspberry Pi 2 Model B

Wed Dec 23, 2015 6:58 pm

Hi,

I ran into the same problem today, with my Raspberry Pi Model B Rev 2.

I got it to run before; however there is one difference between last time and this time: To conserve space on the SDCard (I ran out of storage) I switched from the Raspbian Light edition to minibian, so that I would have a trimmed and sleek version of Debian with really only those libs installed that I need.

While oracle-java8-jdk is nicely integrated into the Raspbian repositories thus installs nicely and smoothly on Minibian, this is not the case for JMEE (Java Mobile Edition Embedded), so it needs to be installed manually. Therefore I suspect that at least in my case, there are libraries missing that JMEE requires, without telling me so. I think something similar might be the case for you as well. I'd need to research which libs specifically are necessary and then try again.

As to the other alternatives suggested: If you don't know what Java ME is, then you better had not answered. Alternatively, if you do, then why did you answer with suggesting alternatives he didn't ask for?

At least I know exactly why I chose to use Java ME to deploy Java on the Raspberry Pi. An extremely small memory footprint is only one of the many.

Cheers,
Michel

rohanhn
Posts: 6
Joined: Fri Mar 11, 2016 2:43 am

Re: Java ME Embedded Runtime For Raspberry Pi 2 Model B

Fri Mar 11, 2016 3:01 am

Hi,

Error because in your RPi have one or more Midlet are running.

Let follow some step to solved that:
  • Sudo top: find PID of Midlet
  • Kill <PID>: to kill Midlet
  • re-run
Hope that help!

mattlewis
Posts: 113
Joined: Sat Jan 12, 2013 3:05 pm
Location: UK
Contact: Website

Re: Java ME Embedded Runtime For Raspberry Pi 2 Model B

Mon Mar 14, 2016 11:03 am

You can also give diozero a try. It's goal is to provide a user-friendly and intuitive API to interacting with low-level devices using Java 8.
Docs: http://rtd.diozero.com/
GitHub: https://github.com/mattjlewis/diozero/

Regards,
Matt
http://www.diozero.com/

Return to “Java”