aussiemcgr
Posts: 3
Joined: Sat Sep 26, 2015 6:27 pm

Java Setup Not Working Properly

Sat Sep 26, 2015 6:32 pm

I have been following Oracle's tutorial for setting up Java ME Embedded 8 on the Pi 2 board (link found below), and I have run into a roadblock.
I set up the Pi, brought the zip folder over, unzipped it all correctly, and then when I attempted to run:

Code: Select all

sudo ./usertest.sh
I received:

Code: Select all

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
And then it just hangs there until I exit java. I Googled around but found nothing. Can someone tell me what this error means and what I can do to resolve it? Thanks in advance.

Tutorial I am following: http://www.oracle.com/webfolder/technet ... Setup.html

User avatar
savageautomate
Posts: 225
Joined: Thu Aug 16, 2012 3:20 pm
Location: USA
Contact: Website

Re: Java Setup Not Working Properly

Sun Sep 27, 2015 4:07 pm

Java 8 SE comes standard on the Raspbian image by default.
Any specific reason to use Java ME?
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com

aussiemcgr
Posts: 3
Joined: Sat Sep 26, 2015 6:27 pm

Re: Java Setup Not Working Properly

Sun Sep 27, 2015 9:08 pm

Um... this is news to me. I have a few questions for you:
1. So Raspbian Wheezy already has the Java 8 runtime on it?
2. If yes, it is the Java 8 SE Embedded, not the full Java 8 SE, correct?
3. So is that tutorial I was following just horribly out of date or something? Why would it tell me to install Java 8 ME if Java 8 SE was already on it (and never mentioned that Java 8 SE was already there)?
4. Do you have any links you can provide me to read more about it?

We were using Java 8 ME because our project is headless, and we were just using an "as much as we need" Java version. However, if Java 8 SE is already there, forget that. We'll use Java 8 SE... lol.

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: Java Setup Not Working Properly

Sun Sep 27, 2015 9:17 pm

I've never used Java, but I guess this is what you're referring to:
https://www.raspberrypi.org/blog/oracle ... spberry-pi
You'll notice that this is in late 2013, so your tutorial is probably out of date.
There are 10 types of people: those who understand binary and those who don't.

User avatar
savageautomate
Posts: 225
Joined: Thu Aug 16, 2012 3:20 pm
Location: USA
Contact: Website

Re: Java Setup Not Working Properly

Sun Sep 27, 2015 10:07 pm

If you are using it for commercial purposes and you are licensing it from Oracle, then I could see using Java ME. If you are building a custom image and want it as lightweight as possible, ME may be the better option.

Just image your SDcard with the latest Raspbian image from the Raspberry Pi foundation's downloads pages and once you have it up and running test using "java -version" and it should report back Oracle's Java 8 Hotspot VM.

It includes the JDK by default, not just the JVM.

Then if you want to access the GPIO/I2C/SPI/SERIAL from Java land, then take a look at the Pi4J project (http://www.pi4j.com) or Oracle's DIO project.
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com

aussiemcgr
Posts: 3
Joined: Sat Sep 26, 2015 6:27 pm

Re: Java Setup Not Working Properly

Sun Sep 27, 2015 10:48 pm

Okay, thank you for all the information. This stuff will help me a lot.

This is actually for a college Senior Design course. So education purposes instead of commercial.

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java Setup Not Working Properly

Mon Sep 28, 2015 7:34 am

It is ok to use OpenJDK If you want to use Java on the Pi for any use-case.
OpenJDK is free software thus you then have the freedoms to run it for any purpose, study it, share it, modify it and share your modified version.
Oracle has confirmed that you may use OpenJDK for any purpose without having to pay a license fee in the forum: viewtopic.php?p=401112#p401112

To install a JRE based on OpenJDK run:

Code: Select all

sudo apt-get update
sudo apt-get install openjdk-7-jre
To install a JDK based on OpenJDK run:

Code: Select all

sudo apt-get update
sudo apt-get install openjdk-7-jdk
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

Return to “Java”