LeJOS & Eclipse Installation Guide for Windows 2000 / XP
An easy way to get started with Java for Lego Mindstorms
Introduction
Eclipse is an open source Integrated Development Environment for JAVA that works perfectly together with LeJOS (Lego Java Operating System), which enables programmers to control Lego Mindstorms with Java. This is a very powerful combination that increases the ease of programming the RCX. Here is a quick guide that explains you how to set it up:
Step 1: Install Java 2 SDK
Step 2: Install LeJOS and Eclipse
- Download the latest version of LeJOS at http://lejos.sourceforge.net and extract the .zip file to C:\ so that you create C:\Lejos\...
- Download version 2.*.* (3.* won't work) of Eclipse at http://www.eclipse.org and extract the .zip file to C:\ so that you create C:\Eclipse
- Download the LeJOS plugin for Eclipse here and extract the .zip file to C:\Eclipse\plugins
Step 3: Setup Eclipse
- Open Eclipse with C:\Eclipse\eclipse.exe
- Click Window -> Preferences
- Go to leJOS pane
- Fill in the leJOS installation directory, which is in this case C:\Lejos
- Choose com1 for RCX communication port
- Choose slow for data transfer rate. If you choose fast, the chance is very high that a data transfers fail since the signal is very sensitive for external light
- Confirm your settings by clicking the OK button
Step 4: Start a project
- Click File -> New -> Project…
- Select “ LeJOS project” and click Next . This wizard will let you enter some details for the project. Usually it's enough to enter your project name and click Finish to confirm
- Open the Java perspective by clicking Window -> Open Perspective -> Java
- To start coding add a new class to the project by clicking File -> New -> Class
- Your code is compiled at your cursor and eclipse will indicate errors at your cursor
Step 5: Patch the RCX firmware for LeJOS
- Make sure that the IR tower is connected to the computer and the RCX is in range of the tower and switched on.
- Click LeJOS -> Firmware Dowload
Step 6: Upload your code to the RCX
- Open the class of your project that contains the main method
- Click LeJOS -> Bytecode Download
© 2004 Tijn Kooijmans