简体   繁体   中英

running the program with calling library

I have an code who called many libraries, when i try to run it in eclipse, i don't get any error like :

在此处输入图片说明

and the program is running perfectly. When i try to compile using cmd, i don't get any errors too like this:

在此处输入图片说明

And it's works. but when i try to run it with :

C:\ListenerZipfile\src>java -cp .;C:\ListenerZipfile\lib\commons-io-2.4.jar;C:\ListenerZipfile\lib\commons-logging.jar;C:\ListenerZipfile\lib\jnotify-0.94.jar;C:\ListenerZipfile\lib\joda-time-1.6.jar;C:\ListenerZipfile\lib\log4j-1.2.11.jar com.xxx.main.ListenerZipFile

it get an error like this : 在此处输入图片说明

how to fix the command?

There's not much to go on, but is it possible you have a log4j configuration file (eg log4j.properties) that's specified using a relative path? Then, when you run the program from the command line it's no longer in the classpath so whatever utility methods you've written can't find it?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM