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. |