Eclipse is a free, full-featured IDE which provides most of the functionality found in other commercial IDEs.  Having been originally developed as a Java IDE, it contains a large feature set required for developing standard 'desktop' Java applications.  Recently, some support has been also added for developing Java CLDC applications using emulators (such as Sun's Wireless Toolkit), but CDC application support is still lacking.  Here, we present the steps and workarounds needed to enable Java application development using Eclipse IDE and Apogee JREs.

Installation.

  • a copy of Eclipse IDE can be obtained free of charge from www.eclipse.org site
  • an evaluation copy of Apogee MJRE or CJRE can be obtained from apogee.com 
    • JRE should be accessible from both host and target machines
    • either copy the contents of JRE to both machines, or use NFS/Samba mount.

Setting up JREs.

Eclipse lacks the built-in support for recognizing Apogee JREs, since their file layout is vastly different from the standard J2SE.  However, Eclipse allows the user to specify the alternate JREs via its 'Execution Environment' mechanism.
  • download foun11.ee (MJRE) or harmony.ee (CJRE) file
    • .ee file should be placed in the toplevel JRE directory, containing 'bin' and 'lib'
  • using eclipse menu system,
    • 'Window'->'Preferences'->'Java'->'Installed JREs'->'Add'
    • 'Execution Environment Description'->'Next'
    • browse to the above .ee file and open it
  • Apogee JRE is added to the list of available JREs.

Developing Java Applications.

Java applications targeting Apogee JREs must reference and use only the APIs that are provided by such JREs.  This can be accomplished by using an Apogee JRE configuration (J2ME Foundation 1.1 or Harmony) as a project-specific JRE in Eclipse.  It entails either selecting 'Use a project specific JRE' during project creation time or by modifying default JRE used by your existing Eclipse projects.  

Running Java Applications.

While developing Java applications can be done entirely on the host system, running and debugging them involves proper setup of the target device.  One possible way to accomplish that is:
  • copy (or make available over NFS/Samba) JRE on the target device
  • copy (or make available over NFS/Samba) application files generated by Eclipse
  • setup a password-less access to the target system from the host
  • overwrite $JRE/bin/j9 executable with the script that will 
    • remap host path into target path for JRE and application
    • login to target system and execute the command line
With the above setup, running Java application from Eclipse will invoke a wrapper script that will remap the arguments and login to target system to execute the actual command line.

Debugging Java Applications.

In order to debug Java applications on the target system, the following steps need to be done:
  • create Run Java Application configuration that will start JRE in debug mode
    • create a copy of configuration used for running JRE
    • provide additional VM arguments: -Xdebug -Xrunjdwp:server=y,suspend=y,address=5678
  • create Debug Remote Java Application that will connect to running JRE
    • specify proper hostname/IP address of the target device
    • specify port number 5678 (or whichever port was used above)