how to set classpath, jarfiles

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
malcolm

how to set classpath, jarfiles

Post by malcolm »

what classpath mean anyway?? what is different between these twp( classpath, jarfiles)
Scott Swank

Re: how to set classpath, jarfiles

Post by Scott Swank »

Malcolm,

The classpath tells the java compiler where class files exist on your computer. This way if a java file that you are trying to compile has a dependency on another class, the compiler can find it. A classpath setting looks something like this:

javac -classpath c:\myclasses;c:\myjarfiles\myjar.jar MyClass.java

Notice the jar file that is referenced in the classpath? A jar file is a Java Archive. Basically a zip file that contains compiled java class files.

You need to do some reading. Try the tutorials at http://java.sun.com.

Regards,
Scott
Post Reply