简体   繁体   中英

Facing “Exception in thread ”main“ java.lang.NoClassDefFoundError: org/apache/commons/io” in command prompt

While trying to compile the Java code facing this problem. Let me know what is missing here.

javac -cp ".;C:\\path for the folder\\WEB-INF\\lib\\commons-io-2.0.1.jar"

GroupJavaScriptFiles.java

java GroupJavaScriptFiles

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/io/IOUtils

Please help.

In this case, you need to use the same -cp option when you run the class as when you compiled it.

java -cp ".;C:\path for the folder\WEB-INF\lib\commons-io-2.0.1.jar" \
        GroupJavaScriptFiles

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