Originally posted by Romka Abcd: where can i find this thing and how can i add *.jar file to it... please give me an example, i really need i
CLASSPATH is typically an environment variable that is set by a script (or batch file). How you find its current value and change it depends on the operating system. For example on Windows 2000 I can examine the value with: and on Unix I might do something like env | grep CLASSPATH. You can also tell java to use a particular value for CLASSPATH by invoking it with -cp or -classpath. You would then supply the classpath values separated by the appropriate delimiter (';' on Windows) like so:
One of the simplest ways to import JAR archives into an application is to add the -classpath attribute (correct term?) on the command line when invoking the JVM for the application. For example: java -classpath %1;%2;%3; MyClass.java Where your replace %1, %2 and %3 with your jar file list, directories, or zip archives. The Java runtime will load classes from any of these location as and when required.
The other way (which is more permanent) is to set an environment variable called CLASSPATH under your operating system's architecture. On Windows, you could do this by opening up the Environment Variables system property (Windows NT, 2000 or XP), or by using the parameter set CLASSPATH=... in the autoexec.bat file (Windows 9x). Under Linux/Solaris, you need to refer to your particular implementation's documentation regarding the shell files (*.csh and *.sh files) and setting environment variables (env). [ June 09, 2003: Message edited by: Charles Lyons ]
Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / AmazonAmazon UK )