how to execute java class file resinding in another directory eg;- if i am executing from c:\test and the class file is in c:\home\agent\test.class how to give execution coomand for this c:\test>java test thanks in advance
Setting CLASSPATH is problematic if not evil and best avoided. Instead add the required jars for your program to your launch script: java -classpath ...
Use the classpath argument to the JVM or set the environment variable just for one run. Frinstance I have no classpath in my environment by default, and this is a typical batch file for me ...
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Another consideration when setting the classpath is if the class is in a package. Then you need to adjust the path so that it plus the package gives the complete path to the file. For example if the package is agent and the file is at C:\files\region1\agent\pgm.class then the classpath should be: C:\files\region1\ When you execute you need the package as part of the name: java agent.pgm
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.