Setting the Classpath at Compile Time

     

You can set the classpath at compile time. This is useful if you have a quick class you want to try out, and it relies on a library or other class that is not currently on your classpath. You do so using the -cp flag. You can also use -classpath if you are exceptionally fond of typing.

Try it like this:

 

 javac -cp C:\garage\classes SomeClass.java 

Note that you can combine flags as well:

 

 javac -source 1.5 -cp      /user/eben/garage/SomeClass.java 



Java Garage
Java Garage
ISBN: 0321246233
EAN: 2147483647
Year: 2006
Pages: 228
Authors: Eben Hewitt

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net