简体   繁体   中英

intellij ide no class def found

I'm trying to use ibm mq jars for my project, I add them to the classpath using module settings. but the problem is when i run the project using intellij ide it fails with mqdata exception no class def found error. however, when i run it using java -classpath it works fine!

I compared the command line that intellij generates with what i run and it seems intellij does not include the classpath of the jar that gets generated after i build my project. could this be an issue?

how to fix this error?

thanks for answering in advance!

NoClassDefFoundError exception is thrown when a class that was found and loaded, attempts to load a class that it depends upon, which is not found.

You have to make sure that all of your dependencies are on the classpath. If you will post your POM file and full StackTrace we might be able to help more.

When you do mvn clean all of the files in the target directory are deleted. Go to Build > Rebuild Project .

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