java - method must call super() error in Netbeans -


recently i've made netbeans project , using svn along it. seeing duplicate class error, , in console says

java.lang.verifyerror: (class: pie/chart/explorer/piechartexplorer, method: <init> signature: ()v) constructor must call super() or this()
not find main class: pie.chart.explorer.piechartexplorer. program exit.
exception in thread "main" java result: 1

here piechartexplorer.java:

package pie.chart.explorer;  import java.awt.*; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.*;  public class piechartexplorer extends jframe implements actionlistener {       jtextfield 1 = new jtextfield(10);      jtextfield 2 = new jtextfield(10);       jtextfield 3 = new jtextfield(10);     jbutton sub = new jbutton("click amazed");       public piechartexplorer() {         super("pie chart explorer");         setsize(300,100);         setdefaultcloseoperation(jframe.exit_on_close);         flowlayout flo = new flowlayout();         setlayout(flo);         setvisible(true);         add(one);         add(two);         add(three);         sub.addactionlistener(this);;         add(sub);      }      public static void main(string[] args) {         piechartexplorer app = new piechartexplorer();     }      @override     public void actionperformed(actionevent e) {         object source = e.getsource();          if(source == sub) {             try {             pie show = new pie(float.parsefloat(one.gettext()),float.parsefloat(two.gettext()),float.parsefloat(three.gettext()));             } catch(exception ex) {                 joptionpane.showmessagedialog(this, "please check entered data");              }         }     }  } 

i have tried:

  1. clean , rebuild project
  2. making sure have called super in constructors

how can fixed? code download.

i saw these symptoms other day.

i had file had been editing , decided wanted split changes 2 commits. went directory containing file "x/y/z.java", made directory in "x/y" named "backup", moved "z.java" there, , pulled fresh copy version control. note of done outside ide.

back in ide merged in changes first commit , when built got duplicate class message "z.java".

when copied source "backup" did outside ide , still had original package "x.y" did newly edited "z.java". nb not compile new "z.java" because see had created "x.y.z.class" (from "x/y/backup/z.java").

there 2 ways fix this:

  1. rename "x/y/backup/z.java" "x/y/backup/z.java.backup". (prevent backup copy being compiled.)
  2. change package in "x/y/backup/z.java" "x.y" "x.y.backup". (make backup create different class file.)

after making either of these changes, perform "clean , build". note: building not fix problem, need perform clean remove rogue class file.

note: #1 done renaming z.java command line, not within nb. nb not let change file extension.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -