|

|
The example below will refer to the Totals sample provided in the XJ distribution (in the
XJJDT\samples\com\ibm\xj\samples\totals directory). We assume that you have unzipped the distribution
and that %XJ_HOME% refers to the XJJDT directory included in the distribution.
The executable xjc in %XJ_HOME%\bin is used to compile programs (it behaves similarly to
javac). The execution of the compiler depends on the presence of a Java Runtime Environment (JRE)
Version 1.4. The executables provided by the XJ distribution use the following mechanisms to discover the
location of the JRE installation on a machine:
- The %JAVA% variable can be set to point to the "java" executable.
- The %JAVA_HOME% environment variable is used to find the JRE
installation on your machine, or
- The %PATH% environment variable is used to find the java executable, or
Assuming that the java executable can be found using one of the three mechanisms,
we can compile programs as follows. Hover your mouse over any line to get additional description.
[Multiline tooltips do not work yet in some browsers.]
[%XJ_HOME%]>
cd samples\com\ibm\xj\samples\totals
[totals]>
set JAVA_HOME=c:\program files\IBM\Java141
[totals]>
set CLASSPATH=%XJ_HOME%\samples;.
[totals]>
"%XJ_HOME%"\bin\xjc Totals.xj
[totals]>
"%XJ_HOME%"\bin\xj com.ibm.xj.samples.totals.Totals chart.xml
Total Sales
1998 72.0
1999 79.0
2000 88.0
<?xml version="1.0" encoding="UTF-8"?>
<sales unit="GBP">430.2</sales>
[totals]>
|
|