Installation under Linux

For other Linux variants than Ubuntu or Debian, the Jabotics components have to be installed manually. You need administrator privileges to perform most of the installation steps. Therefore open a terminal and switch to the user root. Here the focus is on the installation of the Jabotics files. Please refer to the corresponding websites to get more details on the installation of BlueJ and the leJOS libraries.

  1. Installing a Java Development Kit: The chosen JDK should be in line with the current version of BlueJ (e.g. OpenJDK in version 8 plus OpenJFX for BlueJ 4.1).

  2. Installing BlueJ: Download the appropriate package from the BlueJ homepage and follow the installation instructions. It should be possible to start BlueJ now. Depending on the installation paths, it might be necessary to export some environment variables in the BlueJ start script for the Jabotics integration to work properly (see below).

  3. Installing the leJOS libraries: You only have to install the leJOS libraries, if you really intend to work with Lego robots. The installation is not a prerequisite for starting the robot simulation. Also, you can decide to install only one of the leJOS libraries (either for NXT or EV3 robots). The libraries and installation instructions can be obtained via the leJOS homepage. In general the installation includes the following steps:

    • If the NXT libraries are to be installed, check for dependencies that have to be resolved. On Ubuntu / Debian the packages libusb-dev and libbluetooth-dev have to be installed. On 64-bit systems the package lib32z1 is required in addition for compatibility reasons. The NXT installation procedure includes a build step. Therefore ant needs to be installed. Use a suitable package manager for your system to perform necessary installations.

    • Download the current installation packages (like leJOS_NXJ_0.9.1beta-3.tar.gz and leJOS_EV3_0.9.1-beta.tar.gz). In the following we will assume that downloads will temporarily be stored in the directory /var/tmp/.

    • Unpack the packages in the directory /opt (if possible):
      cd /opt
      tar -xzf /var/tmp/leJOS_NXJ_0.9.1beta-3.tar.gz
      tar -xzf /var/tmp/leJOS_EV3_0.9.1beta.tar.gz
      Build the NXT binaries:
      cd /opt/leJOS_NXJ_0.9.1beta-3/build
      You should get the message „BUILD SUCCESSFUL“.

    • A rules file needs to be provided to enable connections to the NXT robot via USB. We will do so once the Jabotics files have been installed.

    • To avoid additional customization effort (compare page on customizing BlueJ), you can create symbolic links to the installation directories:
      cd /opt
      ln -s leJOS_NXJ_0.9.1beta-3 leJOS_NXJ
      ln -s leJOS_EV3_0.9.1beta leJOS_EV3
      Alternatively rename the installation directories by removing the version information:
      cd /opt
      mv leJOS_NXJ_0.9.1beta-3 leJOS_NXJ
      mv leJOS_EV3_0.9.1beta leJOS_EV3

  4. Installing Jabotics: Change to the downloads page to get the current tar archive for Linux (like jabotics-linux-1.1.1.tar.gz). If possible, the archive should be unpacked in the directory /usr/share/:
    cd /usr/share
    tar -xzf /var/tmp/jabotics-linux-1.1.1.tar.gz
    Now we will provide the rules file for the NXT robot:
    cp /usr/share/jabotics/lib/71-lego.rules /etc/udev/rules.d/
    Some additional files have to be copied and symbolic links need to be created. The usage of symbolic links will simplify a later update to a new version of Jabotics. In the following we will assume that the file bluej.defs and the referenced subdirectories can directly be found in /usr/share/bluej/. Alternatively your BlueJ directory might have a lib subdirectory containing the mentioned file and subdirectories. Proceed like this:
    cp /usr/share/jabotics/templates/en/* /usr/share/bluej/english/templates/newclass/
    cp /usr/share/jabotics/templates/de/* /usr/share/bluej/german/templates/newclass/
    ln -s /usr/share/jabotics/lib/jabotics-tools.jar /usr/share/bluej/extensions/jabotics-tools.jar
    ln -s /usr/share/jabotics/lib/jabotics-sim.jar /usr/share/bluej/userlib/jabotics-sim.jar
    Additional steps related to the NXT and EV3 libraries:
    mkdir /opt/leJOS_NXJ/lib/userlib
    ln -s /usr/share/jabotics/lib/jabotics-nxt.jar /opt/leJOS_NXJ/lib/userlib/jabotics-nxt.jar
    mkdir /opt/leJOS_EV3/lib/userlib
    ln -s /usr/share/jabotics/lib/jabotics-ev3.jar /opt/leJOS_EV3/lib/userlib/jabotics-ev3.jar
    ln -s /usr/share/jabotics/lib/manifest-ev3 /opt/leJOS_EV3/lib/userlib/manifest-ev3

  5. Customizing BlueJ: In case of a manual installation it might be necessary to export some environment variables in the BlueJ start script. Please refer to the BlueJ customization page for further details. To integrate the Jabotics API documentation into BlueJ's help menu, the configuration file /usr/share/bluej/bluej.defs (adapt the path if necessary) has to be supplemented accordingly. Here we will simply replace the file with a sample configuration supplied by Jabotics. Before replacing the original file, it will be renamed. In this way it can be restored later if desired:
    cd /usr/share/bluej
    sudo mv bluej.defs bluej.defs.original
    sudo cp /usr/share/jabotics/lib/bluej.defs.en bluej.defs