Chilkat Software Chilkat Software Chilkat Software
Chilkat Software Chilkat Software







Java JAR Archives and classpath

(For more detailed information, see Oracle's documentation for classpath.)

The JVM class loader will only find and use JAR archives that are listed in the classpath. There are several ways to add a JAR to the classpath:

  1. Copy the JAR to one of the directories listed in the CLASSPATH environment variable. To see the current value of the CLASSPATH environment variable, open a terminal and type:
    echo $CLASSPATH
    Another way of viewing the classpath is to run this Java code:
    String classpath = System.getProperty("java.class.path");
  2. Modify the CLASSPATH environment variable to also include the directory containing the JAR archive.

    In csh, the CLASSPATH environment variable is modified with the setenv command. The format is:

    setenv CLASSPATH path1:path2:...
    In sh, the CLASSPATH environment variable can be modified with these commands:
    CLASSPATH = path1:path2:...
    export CLASSPATH
  3. Set the classpath at runtime. There are several possible ways of doing this:
    1. Use the -classpath option:
      javac -classpath ".:/chilkatJava/chilkat.jar"
      java -classpath ".:/chilkatJava/chilkat.jar" Test
    2. Use the -Djava.class.path system property:
      javac -Djava.class.path=.:/chilkatJava/chilkat.jar
      java -Djava.class.path=.:/chilkatJava/chilkat.jar Test

    IMPORTANT:On Windows systems, the semicolon character should be used for the path separator. However, on Linux systems, the colon character should be used.

Privacy Statement. Copyright 2000-2018 Chilkat Software, Inc. All rights reserved.

(Regarding the usage of the Android logo) Portions of this page are reproduced from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

Send feedback to

Software components and libraries for Linux, MAC OS X, iOS, Android™, Solaris, RHEL/CentOS, FreeBSD, MinGW
Azure, Windows 10, Windows 8, Windows Server 2012, Windows 7, 2003 Server, 2008 Server, etc.