Splash Image

Setting up the Classpath for JHDL

The CLASSPATH environment variable tells the Java virtual machine's class loader where it should look for class files. To use JHDL, you must have it in your classpath. This page shows how to do this on some major platforms

  1. Linux/Unix: csh/tcsh
  2. Linux/Unix: bash
  3. Microsoft Windows

Setting Classpath for Linux/Unix platforms running using csh or tcsh

csh and tcsh are command language interpreter typically run from within terminals on Linux or Unix machines. To see if you are using the csh or tcsh shell, you might try running the command

      echo $SHELL
      

For a temporary addition of the JHDL jar to your classpath, you can run the following command:

      setenv CLASSPATH /path/to/jhdl/jar/JHDL.jar:.

where /path/to/jhdl/jar is the directory path to the location where you saved the JHDL.jar. The colon is used to separate elements of the CLASSPATH and the . will include the current directory (whatever it happens to be at any time after you set the CLASSPATH) in the CLASSPATH. If you already have a CLASSPATH variable set and would like to use its current values as well, you can run the following command:

      setenv CLASSPATH "$CLASSPATH":/path/to/jhdl/jar/JHDL.jar

This setting will persist for the duration of the shell session in which the setting is made.

To set up your shell so that the classpath is set every time you start a new shell, you should edit your .cshrc, .tcshrc, or other relevant initialization file. (NOTE: You may need to create this file if it doesn't already exist.) If your initialization file already sets the CLASSPATH, simply add :/path/to/jhdl/jar/JHDL.jar to the end of the setting. If it does not already set the CLASSPATH variable, insert the full setting as follows:

      setenv CLASSPATH /path/to/jhdl/jar/JHDL.jar:.

Setting Classpath for Linux/Unix platforms running using bash

bash is command language interpreter typically run from within terminals on Linux or Unix machines. To see if you are using the bash shell, you might try running the command

      echo $SHELL
      

For a temporary addition of the JHDL jar to your classpath, you can run the following command:

      export CLASSPATH=$CLASSPATH:/path/to/jhdl/jar/JHDL.jar

where /path/to/jhdl/jar is the directory path to the location where you saved the JHDL.jar This setting will persist for the duration of the shell session in which the setting is made. You should make sure that the original $CLASSPATH variable includes . so that the current directory is always included in the CLASSPATH.

To set up your shell so that the classpath is set every time you start a new shell, you should edit your .profile, .bashrc, or other relevant initialization file. (NOTE: You may need to create this file if it doesn't already exist.) If your initialization file already sets the CLASSPATH, simply add :/path/to/jhdl/jar/JHDL.jar to the end of the setting. If it does not already set the CLASSPATH variable, insert the full setting as follows:

      export CLASSPATH=/path/to/jhdl/jar/JHDL.jar:.

Setting Classpath for Microsoft Windows platforms

For a temporary addition of the JHDL jar to your classpath, you can run the following command from the command prompt:

      set CLASSPATH=%CLASSPATH%;DRIVE:\path\to\jhdl\jar\JHDL.jar

where DRIVE:\path\to\jhdl\jar\ is the directory path to the location where you saved the JHDL.jar This setting will persist for the duration of the command prompt session in which the setting is made and is valid only for the command prompt from which the setting is made. You should make sure that the original %CLASSPATH% variable includes . so that the current directory is always included in the CLASSPATH.

To set up your environment so that the CLASSPATH is set all of the time, you should set it in the system environment and variables section of the Control Panels.


jhdl@ee.byu.edu
Last modified: Thu May 30 09:43:59 MDT 2002