Symbian
Symbian OS Library

FAQ-0265 If I use the -classpath switch on the command line, why do I have to include classes.zip?

[Index][spacer] [Previous] [Next]



 

Classification: Java Category: Deployment
Created: 08/06/99 Modified: 12/10/2001
Number: FAQ-0265
Platform: Not Applicable

Question:
If I use the -classpath switch on the command line to specify the location of a class file at run time and don't specify at the same time the location of classes.zip, the classes in classes.zip are not found. Neither are any of the jar files in the \ext directory. Why not?

Answer:
If you use the -classpath switch, you will have to specify explicitly the locations of all the classes you wish to access at runtime, including classes.zip.
The recommended method of modifying the classpath is to use the -cp switch, as documented in the Java SDK docs. This prepends jar files and/or directories containing class files to the current classpath. Then the VM will automatically find classes.zip and any jar files located in the \ext directory. Note that the path to the \ext directory will vary depending on whether you are running on the WINS emulator or a target machine.