up previous next contents index
Next: Running the program on Up: Getting started with Lego Previous: Compiling the HelloWorld program   Contents   Index

Sending the class file to the RCX/brick

Now that you have a HelloWorld.class file, you just need to download it to the brick. This is done with the lejos command - but, *before* doing this - you need to point your infrared tower at the top end of the RCX brick. This is because what you are about to do is download your class file to the brick, and if the tower is pointed into space ... well, that's where your program will go. :)

So, if you have a HelloWorld.class file, point your infrared system at the top of the brick, and enter this command:

lejos HelloWorld

If all goes well, this will successfully download the class file to the brick, and you're ready to run the program. Note that this may take a few seconds. Downloading class files is not a fast process. When it does succeed, you'll hear a "beep beep" tone from the brick indicating the success, and on your command line you'll get a message like the following indicating success:

Download successful!

Now, if you don't get a "success" message like this ... well, I'll try to discuss potential error messages in a future version of this document.

If you are interested in testing this program, you can download this sample program as HelloWorld.java.


up previous next contents index
Next: Running the program on Up: Getting started with Lego Previous: Compiling the HelloWorld program   Contents   Index