Directory hierachy![]() Suppose the 'xyz' and 'web' directories are part of the package of the 'MyJava' class. The full name of the 'MyJava' class is then 'xyz.web.MyJava'.
Java program (class) execution
| ||
The CLASSPATH environment variable must point to the directory just above 'xyz', which is 'classes'.
In Windows 95 and 98 In the Windows 9x environment, to point the CLASSPATH variable on the 'classes' directory, you can add the following line to the autoexec.bat file which is directly in the C: drive (not an autoexec.bat file contained elsewhere, except if you boot from another drive):
The %CLASSPATH% notation represents the existing value of the CLASSPATH variable. Since the SET command replaces the existing value with the new one, to preserve the existing value, you have to include it in the command. This line will be taken into account when you restart your computer.
In Windows NT and XP In Windows NT and XP, you define the CLASSPATH variable from a control panel.
|