Java 8 support

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

skoehler
leJOS Team Member
Posts: 1549
Joined: Thu Oct 30, 2008 4:54 pm

Java 8 support

Postby skoehler » Wed Mar 19, 2014 7:02 pm

Java 8 works fine with 0.9.1, however it requires more effort to get it installed. If you wish to use Java 8 please read through this thread and see the step by step guides kindly provided by other leJOS users. If you are happy to use Java 7 then please see the following page:
http://www.oracle.com/technetwork/java/ ... 00042.html

gabrielsan
New User
Posts: 1
Joined: Thu Apr 17, 2014 2:10 am

Re: Java 8 not yet supported

Postby gabrielsan » Thu Apr 17, 2014 2:14 am

Hi skoehler,

I've just flash my NXT and got HelloWord on it.

I did't noticed this topic before installing java on my w7. I downloaded the last release from java "jdk1.8.0_05"

I compiled and downloaded it to the nxt ( lejos 0.9) with sucess.

Should I unistall it and install jdk1.7 as ou mentioned?

skoehler
leJOS Team Member
Posts: 1549
Joined: Thu Oct 30, 2008 4:54 pm

Re: Java 8 not yet supported

Postby skoehler » Thu Apr 17, 2014 2:16 am

gabrielsan wrote:Hi skoehler,

I've just flash my NXT and got HelloWord on it.

I did't noticed this topic before installing java on my w7. I downloaded the last release from java "jdk1.8.0_05"

I compiled and downloaded it to the nxt ( lejos 0.9) with sucess.

Should I unistall it and install jdk1.7 as ou mentioned?

This thread is about the EV3, not the NXT. Using Java 8 with leJOS NXJ is OK.

ryangardner
New User
Posts: 6
Joined: Sat Jun 21, 2014 12:41 pm

Re: Java 8 not yet supported

Postby ryangardner » Sat Jun 21, 2014 12:51 pm

Is there a discussion on what work is needed to get java 8 to work on the ev3?

I'm very experienced in java, but new to lejos.

If there's some specific issues that need attention, I might be able to help out.

User avatar
gloomyandy
leJOS Team Member
Posts: 5226
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Java 8 not yet supported

Postby gloomyandy » Sat Jun 21, 2014 1:12 pm

The next release will support Java 8 (already there in git master). But the JRE side of things is rather complex. We are talking with Oracle to make it easier for leJOS users. What Java 8 features are you looking for?

ryangardner
New User
Posts: 6
Joined: Sat Jun 21, 2014 12:41 pm

Re: Java 8 not yet supported

Postby ryangardner » Sat Jun 21, 2014 5:56 pm

Lambdas are the main java 8 feature I'm interested in.

I was going to start poking around and see if I could get some of the sensor stuff to have a streaming api or poke around with some of the APIs and see where some of the interfaces could be refactored to make sense as functional interfaces (so they could be implemented in lambdas).

If nashorn was on there, I was going to poke around with the javascript a bit too.

jbenech
New User
Posts: 4
Joined: Sat Jan 31, 2015 4:50 pm

Re: Java 8 not yet supported

Postby jbenech » Thu Mar 05, 2015 8:10 pm

Hello,

For my project (http://jbenech.github.io/gnikrap/) , I am really interested by the javascript part of Java8 which is a completely new implementation.
The reason are:
    * I have made some benchmark on the EV3 and the same script interpreted in by JRE8 is two time faster than the same script interpreted by JRE7.
    * The "integration" of Javascript within Java is far more advanced in JRE8 (typically, you can access to the value of a Map by doing myMap.myKey while in JRE7 you have to do myMap.get("myKey").)

Regards,
Jean.

User avatar
gloomyandy
leJOS Team Member
Posts: 5226
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Java 8 not yet supported

Postby gloomyandy » Thu Mar 05, 2015 9:16 pm

java 8 works fine in 0.9.0 but there is no easy way at the moment to create the required JRE and use it. If you understand Java and Linux and you want to use Java 8, I'm sure you can work it out. If not then best to wait until we either document the process or provide a mechanism to do it automatically.

AlanG
Novice
Posts: 28
Joined: Wed May 21, 2014 10:02 pm

Re: Java 8 not yet supported

Postby AlanG » Wed Mar 25, 2015 6:58 pm

gloomyandy,

I've been keeping up with Oracle's web page that covers the Java SE Embedded downloads:
http://www.oracle.com/technetwork/java/ ... 09751.html

Most recently, I have downloaded the latest Java 7 SE Embedded release (update 75) that's targeted for the EV3's ARM9 processor:
ejre-7u75-fcs-b13-linux-arm-sflt-headless-18_dec_2014.tar.gz
Once I copied that file onto the Windows partition of my EV3's SD card, and booted my EV3, Linux recognized and loaded the new Java version.

Now, Oracle's web page says:
"Note: Java SE Embedded 8 enables developers to create customized JREs using the JRECreate tool. Starting with Java SE Embedded 8, individual JRE downloads for embedded platforms are no longer provided. To get started, download an eJDK bundle suitable for your target platform and follow instructions to create a JRE that suits your application's needs. This change does not affect JRE downloads for Java SE Embedded 7 Update releases." The instructions for using JRECreate are on:
http://docs.oracle.com/javase/8/embedde ... m#JEMAG270

I have downloaded what appears to be the correct EJDK for the EV3's ARM9 and Linux: ejdk-8u33-fcs-linux-arm-sflt.tar.gz

So, it looks to me like I should:
1. Do a JRECreate using this EJDK to produce a Java 8 SE Embedded download ".tar.gz", similar to the one I downloaded for update 75.
2. Copy it to my EV3's SD card.
3. Reboot my EV3 with the SD card, and let Linux do its recognition and loading of the new Java version.

Then, it should just be a matter of recompiling my Java code with Eclipse using a compiler level of 1.8, plus tools from a Java SE 8 JDK.

Am I missing anything?

User avatar
gloomyandy
leJOS Team Member
Posts: 5226
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Java 8 not yet supported

Postby gloomyandy » Wed Mar 25, 2015 8:38 pm

Yes that is pretty much it. You will need to select a suitable profile (we need various capabilities for some of the features supported by leJOS), I think it is compact 2 that you need. I would also recommend that you use the full client VM (as that supports features that we use). You may also have to manually create the *.tar.gz file (which may not be very easy on a Windows system). I can't remember what the name of the *.tar.gz file needs to be but it will need to have a name similar to that used by the standard Oracle Java 7 download as our scripts look for that name (i think it needs to match ejre*.tar.gz but I may be wrong, look at the shell scripts to find out).

ferrer
Novice
Posts: 37
Joined: Wed Jan 30, 2008 10:25 pm

Re: Java 8 not yet supported

Postby ferrer » Mon May 18, 2015 9:11 pm

I was also interested in getting Java 8 working on the EV3. Thanks to the previous hints given on this thread, I was able to make it work without too much trouble. I've written up a blog post describing how precisely I used jrecreate to achieve this.

http://gjf2a.blogspot.com/2015/05/setting-up-lejos-09-with-java-8.html
Gabriel J. Ferrer
Hendrix College

franzy
New User
Posts: 1
Joined: Mon Sep 28, 2015 4:08 pm
Contact:

Re: Java 8 not yet supported

Postby franzy » Mon Sep 28, 2015 4:12 pm

ferrer wrote:I was also interested in getting Java 8 working on the EV3. Thanks to the previous hints given on this thread, I was able to make it work without too much trouble. I've written up a blog post describing how precisely I used jrecreate to achieve this.

http://gjf2a.blogspot.com/2015/05/setting-up-lejos-09-with-java-8.html


1000x thanks dude, i was trying to find it myself already for some time....

JOAN49
New User
Posts: 1
Joined: Wed Nov 04, 2015 6:04 pm

Re: Java 8 not yet supported

Postby JOAN49 » Wed Nov 04, 2015 9:21 pm

Hi
I have successfully install the JRE for java8 on EV3 with windows7 :) . The procedure requires an extra step to generate the environment file using jrecreate and rebuilding the file expected by the leJOS installer. For those interested here is the detailled procedure (lenghty but easy)

The following procedure will install the java 8 environment compatible with leJOS 9.0 from windows 7. The only extra tool needed is 7ZIP (a free tool) which can generate tar and gz format.
In the following I use a temporary directoyr as F:\temp. Replace it with your own temp directory wherever it appears

1-Go to java site http://www.oracle.com/technetwork/java/ ... 82511.html

2-Create an account if you dont have one then Accept Licensee agreement and download
ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz or the latest java8 jre for EV3

3-Unzip this file in your F:\temp directory. For simpler process you may rename the extracted directory (ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz) as ejdk8

4-Go to directory ejdk8\ejdk1.8.0\bin. Save the file jrecreate.bat. Now right click on jrecreate.bat and select "modify".
Add one first line to the bat file as
SET JAVA_HOME=C:\Progra~2\Java\jdk1.8.0_66
this is where java8 is installed on my system. Program~2 stand for Program Files (x86) butis easier to type

5- Start a command window: Start->All prog->Accessory->commands

6- In this window type in the following commands
F:
cd temp
cd ejdk8\ejdk1.8.0\bin
jrecreate.bat --dest newjre --profile compact2 --vm client

It should start creating the new jre files in the directory "newjre" under ejdk8\ejdk1.8.0\bin
wait for the final message.
Close the command windows

7-With file explorer go to F:\temp\ejdk8\ejdk1.8.0\bin. Copy "newjre" directory back to F:temp

8-Rename the "newjre" directory as something expected by LeJOS such as
ejre-8-b132-linux-arm-sflt

9-Right click on it. Open with 7ZIP and add to archive. Select tar format. It will create ejre-8-b132-linux-arm-sflt.tar file

10-Right click on tar copy then add archive with gzip format. It will create ejre-8-b132-linux-arm-sflt.tar.gz
you have created the JRE file for java8 expected by EV3

11-Insert your SD card and format it in FAT16 type.

12-Copy the ejre-8-b132-linux-arm-sflt.tar.gz under the sd card top directory

13-Go to C:\Program Files\leJOS EV3 <here leJOS is installed. Open lejosimage.zip with 7ZIP and extract all files in the SD card top directory.

14-Now remove the SD from PV and insert the card into the EV3 brick then power it. Wait for the end of the install (about 10mn)

If anything goes wrong, format again the SD, empty the F:\temp directory and restart at step 3.
if it persist try another sd card
good luck
:D


Return to “EV3 Software”

Who is online

Users browsing this forum: No registered users and 5 guests