i included a jar file in my project and i m required to mention jar file location each time i compile and run the code how to set class path in advance ? <code> javac -cp location/myjarfilename.jar;. myclass.java java -cp location/myjarfile.java;. myclass <code>
this is wat i m doin i want to set class path and do like <code> java -cp myjarfile.jar;. myclass.java java -cp myjarfile.jar;. myclass <code> how to set class path before compiling and running?like we set path to jdk
Yes, that is exactly how you do it. Probably a bad idea to set the classpath permanently, but if you want to do it, do exactly what you do for setting path, but click the classpath environment variable instead.
Joined: Oct 13, 2005
There is another post about setting classpath here. It has more useful discussion about classpaths, which I think would be helpful for you.