method must call super() error in Netbeans

前端 未结 5 1131
借酒劲吻你
借酒劲吻你 2020-11-30 15:12

Recently I\'ve made a Netbeans project and I am using SVN along with it. I am seeing duplicate class error, and in the console it says

java.lang.VerifyError: (

相关标签:
5条回答
  • 2020-11-30 15:35

    I found that renaming the package did not work, the old package was still there.

    The problem for me started when I copied a package from another application into the current application, which already had a package with the same name. I was trying to add some missing classes to the package. After I did that, the error started.

    To resolve it, I deleted the entire package from the target web app and did a clean and build. Then I copied the source package into the target application. No errors.

    0 讨论(0)
  • 2020-11-30 15:42

    Cleaning and Building solves the problem

    0 讨论(0)
  • 2020-11-30 15:44

    I saw these symptoms just the other day.

    I had I file I had been editing and decided I wanted to split my changes into 2 commits. I went to the directory containing my file "x/y/Z.java", made a directory in "x/y" named "backup", moved "Z.java" there, and pulled a fresh copy from version control. Note all of this was done outside the IDE.

    Back in the IDE I merged in the changes for the first commit and when I built I got the duplicate class message for "Z.java".

    When I copied the source to "backup" I did it outside the IDE and it still had the original package "x.y" as did my newly edited "Z.java". NB would not compile the new "Z.java" because it could see it had already created "x.y.Z.class" (from "x/y/backup/Z.java").

    There are 2 ways to fix this:

    1. Rename "x/y/backup/Z.java" to "x/y/backup/Z.java.backup". (Prevent the backup copy from being compiled.)
    2. Change the package in "x/y/backup/Z.java" from "x.y" to "x.y.backup". (Make the backup create a different class file.)

    After making either of these changes, perform a "clean and build". Note: simply building will not fix the problem, you need to perform a clean to remove the rogue class file.

    Note: #1 was done by renaming Z.java from the command line, not within NB. NB will not let you change the file extension.

    0 讨论(0)
  • 2020-11-30 15:44

    In my case, i had the same problem in a Web application after making an external copy of a POJO and manually editing it outside NETBEANS. The problem actually was what the others suggested in other answers about a conflict in the already compiled .class files.

    What i did to overcome this was simply delete the folder webAppname/WEB-INF/classes (where compiled classes reside) and then do a Clean and Build

    Hope this helps someone

    0 讨论(0)
  • 2020-11-30 15:48

    If you still have the problem, this is how I solved it..

    In my case I changed the class with main method later and the initial class was still referenced in the proporties file.

    Change that setting, clean and build.. It worked for me...

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