method init()v not found

前端 未结 2 1452
后悔当初
后悔当初 2021-01-17 11:04

I\'m rewriting an applet I have, but when it loads it\'s giving me a runtime exception. The exception is

Exception in thread \"main\" java.lang.NoSuchMethodE         


        
相关标签:
2条回答
  • 2021-01-17 11:53

    I had the same problem, but when writing unit tests. The test was failing with this exception when creating the object I wanted to test. I did add a new constructor in the class I was testing and I think I was running an older code which didn't have this constructor. Cleaning and rebuilding the workspace (with maven) solved it for me.

    0 讨论(0)
  • 2021-01-17 11:56

    Line 41 of RunClient is looking for a default constructor on ClientSettings, which doesn't exist. You've defined a constructor that takes a String[], so no default constructor is generated. It looks like the code you've posted isn't what's running, because it seems to show a correct constructor call.

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