![]() |
Cloudscape Basics and the Sample Database
|
|
Getting Acquainted with Class PathWhen you request that a JVM (Java Virtual Machine) execute a Java program, it searches through the class path, a list of directories and jar or zip files that tell the JVM where to look for the program. If your program (or any classes used by the program) is not in the class path, the program does not work. You will get a message like the following: This section covers the following topics:
Setting the Variable vs. Using the Runtime OptionYou will need to set your class path in order to run JBMSTours.CreateToursDB, the first application in the JBMSTours package. There are two ways to set the class path:
In this tutorial, you will set the environment variable temporarily with a script. You will need to run this script every time you open a new command window. How to Specify the Location of Files in the Class PathThe JVM (compiler or interpreter) needs to know the path (operating system-specific instructions about location) of every class file needed by your application. Class files can live in:
NOTE: If you operating system supports it, it is a good idea to use JDK 1.2.x for this tutorial. The CLOUDSCAPE_INSTALL Environment VariableSome versions of the installer automatically create an environment variable called CLOUDSCAPE_INSTALL and set its value to the cloudscape base directory, the directory in which you installed the product. If your version of the installer did not set this environment variable, do it now. For example, if you installed the product in c:\cloudscape, set CLOUDSCAPE_INSTALL to c:\cloudscape. What to Include in the Class Path for this TutorialThis section describes what you need to include in the class path in order to do this tutorial correctly. For some quick help, jump to Determine Your Class Path.
NOTE: If you are using a pre-1.2 JDK, you also need to download Cloudscape's swingall.jar library and add it to your class path. This library is available for download from http://www.cloudscape.com/support/Downloads/. You need to use JDK 1.1.6 or higher.
Figure 2-1 Setting your class path. (JDK library not shown.) In order for Cloudscape applications to work, your class path must include the Cloudscape libraries. The sample application requires the JBMSTours library, which is in /demo/programs/tours. Path SeparatorsYou specify the list of paths as a single string. You must use a separator between paths; the character used as the separator depends on your operating system. Determine Your Class PathTake the time now to determine the exact text of your class path. To review, it should include:
The following is an example class path on a Windows system, where the cloudscape base directory is c:\cloudscape: .;c:\JDK\lib\classes.zip; The following is an example class path on a Windows system, where the cloudscape base directory is C:\cloudscape and the user is working with a pre-3.5 evaluation version of Cloudscape: .;c:\JDK\lib\classes.zip; The following is an example class path on a UNIX system: .:/JDK/classes.zip: The rest of this tutorial will refer to your class path as yourClassPath. You will be setting that in a script (see Customize Your setclasspath Script). |
|
![]() Cloudscape Version 3.6 For information about Cloudscape technical support, go to: www.cloudscape.com/support/.Copyright © 1998, 1999, 2000 Informix Software, Inc. All rights reserved. |