search

Home  >  Q&A  >  body text

shell - 为什么linux下运行java会出现java.lang.NoClassDefFoundError?


如图,我已经在/root/lib目录下放了dom4j的包,而且也在CLASSPATH里面设置了/root/lib,但是运行我的java程序,总是提示找不到dom4j的SAXReader。

求解,谢谢!

迷茫迷茫2776 days ago771

reply all(1)I'll reply

  • 迷茫

    迷茫2017-04-18 10:14:37

    I have encountered this problem before. The classpath is not the directory where the package is added, but the jar package. You need to add root/lib/xxx.jar to the end of the classpath

    reply
    0
  • Cancelreply