Using Batch Files to Compile Samples

In this section:

Information Builders encourages developers to alter and recompile these applications as they see fit. 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, and change the call command in environment.bat to the proper command in your environment.


Top of page

x
Compiling Sample Files

How to:

SamplesComp.bat is provided to automatically compile all 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 they see fit.

In order to use SamplesComp.bat, you need to modify environment specific settings.



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

Below are the contents of SamplesComp.bat

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

where:

JVMpath

Is the path to the javac executable associated with your JVM. For example, the JVMpath might be C:\Program Files\Java\jdk1.5.0_09\bin\java

jarpath

Contains the path to the ReportCaster Jar Files. For example, your path might be C:\ibi\WebFOCUS77\ReportCaster\reportcaster.jar;.

Note: The jarpath 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 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.


WebFOCUS