Using Batch Files to Compile Samples

In this section:

Information Builders encourages developers to alter and recompile these applications, as needed. However, in order to make this more convenient, batch files are included with the product to assist in the compilation and execution of these samples. The batch files were written and tested in a Windows environment.

In order to run the batch files in UNIX, change the extension of the executable from .bat to the accepted scripting extension in your environment (for example, .sh) and change the call command in environment.bat to the proper command in your environment.

Note: The batch files are documented for a Windows environment, but are also provided for a UNIX environment.


Top of page

x
Compiling Sample Files

How to:

SamplesComp.bat is provided to automatically compile all of the .java files included with the samples. It automatically places the generated class files in a directory called CompiledClasses. Developers can feel free to modify or enhance this script to place the compiled classes in any directory indicated.

Before using SamplesComp.bat, you must first modify the settings that are specific to your environment.



x
Syntax: How to Configure the SamplesComp.bat Batch File

This section defines the contents and variable descriptions for the SamplesComp.bat file. An example is also provided.

set JAVA_RUN=[jvmpath]
set CLASSPATH= .; [jarpath]; )
%JAVA_RUN% -g [root]/ibi/WebFOCUS81/ReportCaster/Samples/*.java -d
[root]/ibi/WebFOCUS81/ReportCaster/Samples/Tools/CompiledCode

where:

jvmpath

Is the path to the javac executable (that is javac.exe) associated with your JVM. For example:

C:\Program Files\Java\jdk1.6.0_17\bin\javac
jarpath

Is the path to the ReportCaster .jar files. For example:

C:\ibi\WebFOCUS81\ReportCaster\reportcaster.jar;

Note: The jarpath, which is included with the API samples and used in the examples, points to reportcaster.jar in the /lib directory of the Distribution Server. This directory contains all of the other necessary jar files to enable the ReportCaster API to work with WebFOCUS. You can also point to reportcaster.jar in the WEB-INF directory on the application server. You may need to modify the classpath to include other required .jar files. If your API application does not have access to these directories, you must include reportcaster.jar and the other jar files in your application.

root

Is the directory structure prior to the /ibi directory on your machine. You need to replace this value twice in the string after the JAVA_RUN command is invoked.

For example:

set JAVA_RUN="C:\Program Files\Java\jdk1.6.0_17\bin\javac"
set CLASSPATH= .;C: \ibi\WebFOCUS81\ReportCaster\lib\reportcaster.jar
%JAVA_RUN%  -g C: /ibi/WebFOCUS81/ReportCaster/Samples/*.java -d C: /ibi/WebFOCUS81/ReportCaster/Samples/Tools/CompiledCode

WebFOCUS