How do I fix a NoSuchMethodError?

前端 未结 29 2934
孤独总比滥情好
孤独总比滥情好 2020-11-21 05:08

I\'m getting a NoSuchMethodError error when running my Java program. What\'s wrong and how do I fix it?

29条回答
  •  天涯浪人
    2020-11-21 05:59

    I was having your problem, and this is how I fixed it. The following steps are a working way to add a library. I had done the first two steps right, but I hadn't done the last one by dragging the ".jar" file direct from the file system into the "lib" folder on my eclipse project. Additionally, I had to remove the previous version of the library from both the build path and the "lib" folder.

    Step 1 - Add .jar to build path

    enter image description here

    Step 2 - Associate sources and javadocs (optional)

    enter image description here

    Step 3 - Actually drag .jar file into "lib" folder (not optional)

    enter image description here

提交回复
热议问题