![]() ![]() |
JClass DesktopViews and your Development Environment
JClass DesktopViews JAR Files
JClass DesktopViews and your CLASSPATH
Integrating JClass DesktopViews into your Ant Build Scripts
Demos and Examples
JClass DesktopViews JAR Files
The JClass JAR files are located in the lib subdirectory of your JClass DesktopViews installation. Several JClass products have versions that are optimized for databinding with an IDE or with JClass DataSource. The following table helps determine the JClass product JAR file to install for use with your application.
Other JAR Files
Along with the standard JClass DesktopViews JARs, your installation will include three other JARs files:
JClass DesktopViews and your CLASSPATH
The Java Virtual Machine (JVM) and other applications use the CLASSPATH environment variable to locate user-defined classes. You should ensure that the CLASSPATH points to the location of the JClass DesktopViews JAR files (and any other classes you develop). The Windows installation program does this automatically. UNIX users must manually configure their CLASSPATH.
Two entries should be part of the CLASSPATH:
- one specifying the JClass product classes (a JAR file located in the product's \lib\ directory)
- one specifying the installation directory (necessary to run JClass example and demo programs). You should not need to extract the JAR archive to develop with JClass DesktopViews products
Setting the CLASSPATH in Windows 2000 and Windows XP
Open the Control Panel and select System. Locate the environment variables on the Environment tab (NT) or Advanced tab (Windows 2000 and Windows XP).
Look for a CLASSPATH environment variable (if it doesn't exist, create it), and make sure that the JClass JAR location and home location are in the variable. For example, to include JClass Chart in the CLASSPATH, add the following value to the variable:
[existing-classes];C:\JCLASS_HOME\lib\jcchart.jar;C:\JCLASS_HOME;The following illustrates a CLASSPATH setting on Windows NT; your actual setting may vary or have additional directories/JAR files.
Setting the CLASSPATH in UNIX
In UNIX, you must manually configure the CLASSPATH environment variable before you can start using any JClass DesktopViews product. The CLASSPATH must point to the location of the classes and installation directory.
For example, to set the CLASSPATH for JClass Chart, add a setenv command to your startup file (such as .cshrc) to set CLASSPATH to point to the classes, for example:
setenv CLASSPATH $CLASSPATH
${JCLASS_HOME}/lib/jcchart.jar:
${JCLASS_HOME}If you are using the Bourne Shell, the commands are:
CLASSPATH=$CLASSPATH:/${JCLASS_HOME}/lib/jcchart.jar:
${JCLASS_HOME}
export CLASSPATH
Integrating JClass DesktopViews into your Ant Build Scripts
In order to compile your JClass application using the popular Ant build tool, you must ensure that the JClass JAR files you are using are specified in the CLASSPATH of the
<project name="JClassApp"><javac>
task that performs the compilation. If your environment's CLASSPATH setting includes the JClass JARs, then they will automatically be available for any<javac>
task you use. However, we recommend that you specify explicitly the JClass JAR files to be used via a nested<fileset>
. For example:
<!-- Enable the prefix env for accessing environment variables -->
<property environment="env" />
<!-- Set a property, jcse_home, to be used throughout the build file when
referring to your JClass installation -->
<property name="jcse_home" value="env.JCLASS_HOME" />
<!-- Set some properties specific to our application -->
<property name="srcdir" value="src" />
<property name="builddir" value="build" />
<!-- Create a path containing the required JClass JAR files -->
<path id="jclass_jars">
<fileset dir="${jcse_home}/lib">
<include name="*.jar" />
</fileset>
</path>
<target name="compile" description="Compiles all .java files in our
JClass application src directory">
<javac srcdir="${srcdir}"
sourcepath=""
includeAntRuntime="no"
includeJavaRuntime="no"
fork="yes">
<!-- Make sure to fork a new process to ensure your
explicit settings are used -->
<classpath refid="jclass_jars" />
<!-- Specify the JClass jars on the 'CLASSPATH' -->
<patternset refid="**/*.java" />
</javac>
</target>
</project>Your JClass installation includes an Ant script that demonstrates various ways of integrating JClass with your Ant environment, using the demos and examples as a sample "application". Located in the bin directory, execute
ant -f demobuilder.xml
for instructions on how to use the various tasks it contains.
Demos and Examples
JClass products include an Example & Demo Gallery. Demos are meant to show real-world uses of the product, while examples provide short, simple code examples for particular components. When you install a JClass product, the demos and examples of that product will automatically be installed.
Your CLASSPATH and JCLASS_HOME environment variables must be set correctly in order to run the demos and examples.
Note: UNIX (as well as Windows) users can run the Example & Demo Gallery via an executable. You can run the launchers by entering the following at a command prompt:
cd JCLASS_HOME/bin
jcexamples
![]() ![]() |