Problem with running a java program

Hi,

I can compile a java program as javac -classpath C:\mets.jar test.java

without any problem. However, when I try to run the program as

java -classpath C:\mets.jar test. I got the error message as "Exception in thread "main" java.lang.NoClassDefFoundError. I checked my classpath and path, and they both are setup with C:\Program Files\Java\jre1.5.0_06\bin. I am not sure what is wrong with my setting.

Thanks

[444 byte] By [babychickena] at [2007-10-3 8:13:14]
# 1

When you compile using the command you posted, a test.class file is created in the current directory. When you run using the command you posted, you are telling java to look only in mets.jar for .class files. Java won't look in the current directory, where test.class file is. If you change the command so the classpath is "c:\mets.jar;." then java will look in the current directory as well as the mets.jar file.

atmguya at 2007-7-15 3:17:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...