The dreaded java.lang.NoClassDefFoundError

后端 未结 7 1492
隐瞒了意图╮
隐瞒了意图╮ 2020-12-10 18:13

I\'ve looked through many of the existing threads about this error, but still no luck. I\'m not even trying to package a jar or use any third-party packaging tools. I\'m s

相关标签:
7条回答
  • 2020-12-10 19:02

    Eclipse doesn't build executable java classes by default. Don't ask me why, but it probably has something to do with using their own tools.jar (somewhere in plugins/org.eclipse.core ?) so that Eclipse can run without a JDK.

    You can usually go to your project bin directory and do:

    java -cp . MyClass
    

    But if you have external jars, Eclipse handles those internally in another weird way, so you'll need to add those too.

    0 讨论(0)
提交回复
热议问题