Practical
Embedded Java

aJile 4.X Debug


A practical engineering approach to using embedded Java in real-world applications.


...



Here' some help with fixing some common installation problems. If you find more please post them to the Google SystronixJava group.


Debug aJile 4.3.03 (2007 July 20)
Problem
Solution
Ant can't find the the aJile com.ajile.tools.ant.JemBuilderTask class when running the Systronix build.xml file.

My aJile environment variable somehow remained at the old (for aJile 3.16.09) setting of C:\aJile\Runtime_cldc - it must be (for 4.X) C:\aJile\Runtime_cldc11. After changing it manually in Settings->Control Panel->System-Advanced I still got this error! Hmmm.

This build works on my desktop PC but not my notebook. This class is located in C:\aJile\Ant\ajileant.jar. Urk, I forgot to copy ajileant.jar from C:\aJile\Ant to {ANT_HOME}\lib so that Ant can find the JemBuilderTask class.

command line Ant finds enviroment variables but Eclipse doesn't

Sounds odd I know. I've had to close and restart Eclipse to get it to read system enviroment variables. Closing and re-opening, and/or refreshing projects doesn't work.

Remember you have to open a new command line window after changing environment variables. Any already-open command line windows won't see environment changes.

javac can't find base classes

Running SerialEcho's build.xml with Ant from the command line I get errors like this:

init:
[echo] This is the SystronixExampleSerialEcho project, with package path com/systronix/example

[echo] ANT_HOME is set to = D:\javasoft\apache-ant-1.6.5
[echo] JAVA_HOME is set to = C:\JavaSoft\jdk1.5.0_07
[echo] JAVA_LIB is set to J:\java_lib
[echo] TINI_HOME is set to D:\tini1.17
[echo] TStik IP is set to 192.168.1.102
[echo] CLDC_HOME is set to = D:\javasoft\cldc11\j2me_cldc
[echo] AJILE_HOME is set to = C:\aJile
[echo] AJILE_CLDC is set to = C:\aJile\Runtime_cldc11
[echo] Cleaning build and output folders

ajile_compile:
[echo] AJILE_CLDC is set to C:\aJile\Runtime_cldc11
[echo] javac should have the -target 1.1 switch
[javac] Compiling 1 source file to P:\hardware\boards\JStamp\SerialEcho\classes
[javac] P:\hardware\boards\JStamp\SerialEcho\src\com\systronix\example\SerialEcho.java:3: cannot find symbol
[javac] symbol : class IOException
[javac] location: package java.io
[javac] import java.io.IOException;
[javac] ^
[javac]

So you can see the variables are set up OK. Line 3 in the source is:
import java.io.IOException;
But clearly, javac can't find the ME base class library... why?

Here's where to look in build.xml:
bootclasspath="
${env.AJILE_CLDC}/Rts.jar;
${env.AJILE_CLDC}/classes.jar
${env.CLDC_HOME}/bin/common/api/classes.jar"

Urk! A missing semicolon on the second entry. Plus I left out the SystronixUtils entry. Here's the one that works:
bootclasspath="
  ${env.AJILE_CLDC}/Rts.jar;
  ${env.AJILE_CLDC}/classes.jar;
  ${env.CLDC_HOME}/bin/common/api/classes.jar;
  ${env.JAVA_LIB}/util/SystronixUtils.jar;
"
I don't know if this style of the closing " on a line by itself, and putting a semicolon after the last line is OK or not but at least it makes each line consistent.

And now I have updated the file download too so the build.xml is correct.

Important Notes:
  1. You MUST have the latest Systronix configurations for this example to work.

 
Systronix® 939 Edison St, Salt Lake City, Utah, USA 84111
Tel +1-801-534-1017, Fax +1-801-534-1019
contact us     Time Zone: MDT (UTC-6)
 

Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
Systronix is independent of Sun Microsystems, Inc.
TStik, JStik, JCX, JStamp, JSimm, JDroid, and JRealTime are trademarks of Systronix, Inc.
1-Wire, iButton and TINI are trademarks of Dallas Semiconductor
Simmstick is a trademark of Dontronics
LEGO® is a trademark of Lego A/S, Denmark