Installing leJOS

Sven Köhler Andy Shaw Lawrie Griffiths

Installing leJOS

To install leJOS you will need a blank SD card of at least 2GB and no more than 32GB. SDXC cards are not supported by the EV3 hardware. The card needs to be formatted with a FAT32 partition. We recommend that you use the following program to format the card: https://www.sdcard.org/downloads/formatter_4/ Even if the card is new it is worth using this program as SD cards sometimes have hidden partitions on them which can cause problems with the EV3.

To install leJOS on Microsoft Windows, see [Windows Installation]

If you're using Linux or Mac OS X, then download a file named leJOS_EV3_<version>.tar.gz from the leJOS EV3 download page and unpack it.

If you are using Eclipse, you can install the Eclipse plugin, and set the EV3_HOME preference
setting to the directory that you unpacked leJOS to (the leJOS home directory).

If you are not an Eclipse user or do not want to use the plugin, see [Using ant build files] for an alternative way to create runnable jar files and upload them to the EV3.

To use the command line tools, you should set the environment variables EV3_HOME to point to the
leJOS home directory and include the bin directory on your PATH.

You can also set LEJOS_EV3_JAVA_HOME if you want leJOS to use a specific version of the JDK.

To use the leJOS samples you should import the samples.zip file into Eclipse.

The development source of leJOS is available in the source.tar.gz file. This only includes the Java
source. To get the source for the SD card Linux system, you should go to the Git ev3sdcard repository.

After you have installed leJOS on your PC, you will need to create an SD card. To do this you need an empty SD card with a FAT32 partition of at least 200MB. The card itself should be at least 1GB and no more than 32GB. SDXC cards are not supported by the EV3 hardware.

If your card does not have a FAT32 partition, you can use a partition utility to reformat it as FAT32, or write the sd500.img file in the sd500.zip file (which is part of the distribution) to the disk as an image file (using dd or a disk image writing utility).

You should then unzip the lejosimage.zip file from the leJOS home directory to the root directory of the card, and download and copy the Oracle JRE .tar.gz file to the card. The file is available at http://java.com/legomindstorms You will need to create a free Oracle account, if you do not have one.

When you have written these files to the card, safely remove it, put it in the EV3 and boot the EV3. leJOS will then reformat your card to have a 500MB FAT32 partition and a Linux ext2 partition using the rest of the card. It will prepare the card for use by leJOS showing you its progress as it goes. This process takes about 8 minutes.

If you are a Windows user, but have trouble with the installer for any reason, you can use the zip distribution instead, and install it manually as described here.


Related

EV3 Wiki: Getting started with leJOS EV3
EV3 Wiki: Using ant build files
EV3 Wiki: Windows Installation

Discussion

  • Ryox

    Ryox - 2015-12-19

    The installation always get stuck on "Installing rootfs" when creating the bootable SD-card with the LeJos utility. To work-around that I had to manually copy sd500.img. See the section about it in the article ("write the sd500.img file in the sd500.zip file (which is part of the distribution) to the disk as an image file (using dd or a disk image writing utility)")

     
    Last edit: Ryox 2015-12-19
  • Frank Bergmann

    Frank Bergmann - 2017-02-20

    example linux installation:

    unzip sd500.zip 
    cat sd500.img >/dev/sdb
    cd /run/media/*/SD500/
    unzip /home/*/ev3/leJOS_EV3_0.9.1-beta/lejosimage.zip
    cp -af /home/*/ev3/ejre-7u75-fcs-b13-linux-arm-sflt-headless-18_dec_2014_armv5.tar.gz .
    

    After that the FS looks like this:

    ls -l
    total 63660
    -rw-r--r--. 1 abcdef abcdef      792 Nov 15  2015 boot.scr
    -rw-r--r--. 1 abcdef abcdef 33545828 Dec 22  2014 ejre-7u75-fcs-b13-linux-arm-sflt-headless-18_dec_2014_armv5.tar.gz
    drwxr-xr-x. 4 abcdef abcdef     4096 Nov 15  2015 lejos
    -rw-r--r--. 1 abcdef abcdef 20084268 Nov 15  2015 lejosimage.bz2
    -rw-r--r--. 1 abcdef abcdef  9417944 Nov 15  2015 rootfs.cpio.gz
    -rw-r--r--. 1 abcdef abcdef  2117928 Nov 15  2015 uImage
    -rw-r--r--. 1 abcdef abcdef       11 Nov 15  2015 version
    

    Then put sd card in ev3 and let it do the final setup.

    Checking java version (after setup by ev3):

    ( cd /run/media/*/*/home/root/lejos/../../..;qemu-arm -cpu arm926 -L . home/root/lejos/ejre*/bin/java -version ; )
    java version "1.7.0_75"
    Java(TM) SE Embedded Runtime Environment (build 1.7.0_75-b13, headless)
    Java HotSpot(TM) Embedded Client VM (build 24.75-b04, mixed mode, sharing)
    
     
    Last edit: Frank Bergmann 2017-02-20

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks