Previous  

Bean Works Quickstart

Step 3: Compiling and running your bean from the command line

The Bean Wizard generates batch files you can run from the command line to compile and run your component code. To compile your project from a Windows command line:

1. Go to the directory containing the source code for your project. For example:
> cd WebRunner\BeanTools\bin\mySample
2. Run the build batch file:

> build

This invokes the Java compiler to build your project.

The Bean Wizard also generates a batch file that correctly sets your environment variables and launches your component. You can use the batch file or you can explicitly execute the necessary steps.

To setup and run your bean using the batch file:

1. Go to the directory of the directory containing the compiled source code for your project. For example:
> cd WebRunner\BeanTools\bin\mySample
2. Run the run batch file:

> run

To setup and run your bean without using the batch file:

1. Add your project's source directory to your CLASSPATH environment variable.
Go to the parent directory of the directory containing the source code for your project. For example, if your source code is in WebRunner\BeanTools\bin\mySample:

> cd WebRunner\BeanTools\bin

2. To set the CLASSPATH variable, type:

> set CLASSPATH = %CLASSPATH%;dir

where dir  is the parent directory of the source directory for your project. For example, if your source code is in WebRunner\BeanTools\bin\mySample:

> set CLASSPATH = %CLASSPATH%;c:\WebRunner\BeanTools\bin

3. Launch the Java applet viewer.
To run the component, type:

> java package.class

where package  is the package name for your project and class  is the name of the class containing the main method. For Bean Works programs the main method is provided in the component's controller, which has the same name as the project. So, for example, type:

> java mySample.MySample

to run the default component generated by the Bean Wizard.


Previous  

Copyright © Taligent, Inc. 1996 - 1997.
Copyright
© IBM Corporation 1996 - 1997.
All Rights Reserved.