Login  Register

Re: Trouble executing jar Plugin - nosuchmethod error

Posted by Michael Schmid on Mar 14, 2014; 4:20pm
URL: http://imagej.273.s1.nabble.com/Trouble-executing-jar-Plugin-nosuchmethod-error-tp5006911p5006921.html

Hi Steven,

the error seems to occur in your code, and it is difficult to guess what is the problem without seeing the code!

One possible thing to check for: Does your Gui class have a constructor? If it extends some other (super-)class, and you have somewhere
  Gui myGui = new Gui();
or
  new Gui().someMethodOfGui(args);

you need a constructor. The default would be

public class Gui extends SuperGuiClass {
  public Gui() {
     super();
  }
 // and the rest of the code ...
}

A typical way to get such an error seems to be if a no-argument constructor SuperGuiClass() does not exist. In this case, you might call super(someNiceDefaultArguments) in the constructor.


Michael
________________________________________________________________
On Mar 14, 2014, at 11:45, Influenza wrote:

> hello Everyone,
>
> i developed a IJ Plugin with Eclipse and it used work in that environment.
> Now I want to publish the Plugin but I have some trouble with instlling the
> Plugin:
>
> I took the jar file from the workspace directory and added a plugins.config
> similiar to the example. The plugin is now available at the Menu
> "Plugin-...".
> When I tried to start it, it first threw me an UnsupportedClassVersionError
> whereupon I changed the System Library from Java 1.7. to Java 1.6. After
> replacing the .jar file and updating the .config I now get:
>
> ImageJ 1.47v; Java 1.6.0_20 [32-bit]; Windows 7 6.1; 14MB of 1536MB (<1%)
>
> java.lang.NoSuchMethodError: Gui: method <init>()V not found
> at Mikro_EvalDesk.run(Mikro_EvalDesk.java:24)
> at ij.IJ.runUserPlugIn(IJ.java:195)
> at ij.IJ.runPlugIn(IJ.java:160)
> at ij.Executer.runCommand(Executer.java:128)
> at ij.Executer.run(Executer.java:64)
> at java.lang.Thread.run(Thread.java:619)
>
> Gui is the GUI of that Plugin and is defined in a class within the .jar
> file.
> Can anyone solve my problem?
>
> Thanks for your support!
> Steven
>
>
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Trouble-executing-jar-Plugin-nosuchmethod-error-tp5006911.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html