views:

298

answers:

2

Hi,

I am trying to compile a java source file on command prompt with the following command

C:\temp\test>javac -cp ".\*;"  *.java

but the class does not get compiles, i have errors of type files not found, or could not find resource...

Even though the jars are present in the same directory as the java files.

Any help asap is highly appreciated

Thanks in advance

+2  A: 

C:\temp\test>javac -cp ".;*.jar" *.java

See http://java.sun.com/javase/6/docs/technotes/tools/windows/classpath.html

Stephen Denne
A: 

It is easy to forget that a .jar file is a compressed file system structure, not a .class file. When you specify a directory in -classpath, all .class files in that directory are available to the loader. Specifying a .jar file is analogous to specifying a directory, but in addition to the .class files in the .jar file's root directory, it also makes available .class files in the packages compressed into the .jar structure. Remember that the package structure mirrors a directory structure.

Mark Jaeger