Skip Headers
Oracle® Java ME Embedded Getting Started Guide for the Reference Platform (Raspberry Pi)
Release 8
  Go To Table Of Contents


1 Installing Oracle Java ME Embedded Software on the Raspberry Pi Board

This chapter describes installing the Oracle Java ME Embedded 8 software on the Raspberry Pi board, installing and using the Developer Agent program on the desktop host, configuring the Oracle Java ME Embedded system, connecting to the Raspberry Pi using a secure shell, and installing and running an Oracle Java ME Embedded application.

The following items are required for developing on the Raspberry Pi board:

Downloading and Installing the PuTTY Terminal Emulator Program

Download the PuTTY terminal emulator program (putty.exe) from the following site:

The terminal emulator executable file is directly downloadable as putty.exe. The terminal emulator is used to connect to the AMS command-line interface (CLI) that sends commands to the board.


Using the PuTTY terminal emulator program is highly recommended. You can use any terminal program to connect to the CLI, however, Oracle cannot guarantee that other terminal programs work with the CLI in the same manner as PuTTY.

Preparing the Raspberry Pi Board

To develop applications on the Raspberry Pi board, you must first download and install the Wheezy variant of Raspbian Debian Linux on the Raspbian Pi board. To do this, follow these steps:

  1. Download the Raspbian Wheezy hard-float (Debian Linux) raw image ZIP file to your desktop from the following site:

  2. Unzip the distribution file, which creates a single disk image (.img) file.

  3. Mount the SD card to the desktop, and use a utility to write the disk image file to the SD card. Note that this is not the same as copying the file to the base-level directory on the SD card. Instead, it is similar to burning a disk image onto a CD-ROM or DVD-ROM. There are a number of utilities that will perform this action:

  4. Eject or unmount the SD card from the desktop computer.

  5. Connect the RJ-45 network cable, monitor, keyboard, and mouse.

  6. Install the SD card in the Raspberry Pi board.

  7. Connect power to the Raspberry Pi board. The red light on the Raspberry Pi board should glow, then in a few seconds, the green light should blink. The blinking green light indicates that the Raspberry Pi board is booting Linux.

  8. If the Linux installation was successful, the Raspberry Pi board will start and obtain a DHCP address.

  9. A configuration program (raspi-config) runs, which helps you expand the file system partition on the SD card, configure the keyboard and time zone, reset the default password, and so on. Use the up and down arrow keys to make a menu choice. Use the left or right arrow keys to select OK or Cancel. Press Return to run your choice. Note that the default user name is pi, and the default password is raspberry.

  10. You can perform an update, start the ssh server, and set the graphical desktop to automatically start, then click Finish. At this point, the board should reboot.

  11. Log in if necessary, and if you are using the desktop, start an LXTerminal.

  12. Run the ifconfig command to display the Raspberry Pi IP address. This is necessary so you can access and control the board remotely. Remember this IP address; it will be used in the next set of steps.

Installing the Oracle Java ME Embedded Software

Version 8 of the Oracle Java ME Embedded software contains a different architecture than previous versions. With version 8, the user has the option to run a Developer Agent program on the desktop under Windows. Commands that are sent to the board from the Windows desktop are no longer sent directly across the network. Instead, they are sent to the Developer Agent program, which transmits all communication to and from the Oracle Java ME Embedded executable file on the Raspberry Pi board.

The Oracle Java ME Embedded ZIP archive consists of the following directories:

You must make two copies of the Oracle Java ME Embedded ZIP archive file. The first remains on the Windows desktop, while the second must be transferred to the Raspberry Pi board.

  1. Use an sftp client or scp command to transfer one copy of the Oracle Java ME Embedded ZIP archive to the Raspberry Pi board. For example, on a UNIX or Mac system, you can transfer the ZIP file using a command similar to the following:

    $sftp pi@[IP address of board]
  2. Windows users can download the psftp.exe to obtain a free SFTP client; it is available from the same address as the PuTTY executable:

  3. After the ZIP archive is transferred, either go directly to the keyboard and the mouse connected to the Raspberry Pi board, or start a secure shell script on your desktop to connect to the board using the following command:

    $ssh -l pi [IP address of board]
  4. Unzip the archive on the Raspberry Pi board and perform the following command:

    $chmod -R 755 appdb bin
  5. cd to the bin directory. The contents of the bin directory are shown in Figure 1-1.

Figure 1-1 Raspberry Pi Bin Directory

Description of Figure 1-1 follows
Description of "Figure 1-1 Raspberry Pi Bin Directory"

Adding an HTTP Proxy for Network Connections on Raspberry Pi

If an HTTP proxy server is required for the Java IMlets on Raspberry Pi to make network connections (such as for HTTP or apt-get), then Oracle Java ME Embedded on Raspberry Pi can be configured by adding the following lines to the end of the bin/jwc_properties.ini file: = = 80