Call an ImageJ macro from Netbeans

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Call an ImageJ macro from Netbeans

nath02
Hello everybody


I wrote a macro.txt on the ImageJ environment. It works very well when I call it with Plugins>Macro>Run.

Now, I'm writting a JAVA program on Netbeans 7.1.1. In this program, I really need to call macro.txt. That's why I'm using the IJ library with the following part of code :

String retval = "";
retval = IJ.runMacroFile(script);

When I do a print of "script", I get exactly the path+the name of the script.

But here is my problem, it compiles without any problem but when I execute my program, I get this error :

This plugin or macro requires ImageJ 1.41 or later.

I really don't understand because I have the 1.47v version of ImageJ installed on my computer. So, it should work ? To give you more information, I use the 1.6.0_20 (64-bit) version JAVA and Netbeans 7.1.1.
(also, I'm working on Windows 7). When I change the name of the macro, with a wrong one, I get this error : Macro file not found
I guess it means it's making a link with ImageJ ? Could you give me a clue to understand what happens ?

I have also tested with the "runMacro" function, and in this case, I get this error :

Undefined variable in line 1.
 
<C> : \ Users \ xxx \ Documents \ ImageJ \ plugins \ xxxscript . txt

But I don't understand because the macro exists at this place

Can you help me please ?


Thank you very much for all your advices !


Nath

Reply | Threaded
Open this post in threaded view
|

Re: Call an ImageJ macro from Netbeans

Jerome Mutterer-3
Dear Nath.

You should probably import a newer version of ij.jar in your netbeans
project.
See http://stackoverflow.com/questions/4879903/how-to-add-a-jar-in-netbeans

Jerome


On 27 August 2014 15:31, nath02 <[hidden email]> wrote:

> Hello everybody
>
>
> I wrote a macro.txt on the ImageJ environment. It works very well when I
> call it with Plugins>Macro>Run.
>
> Now, I'm writting a JAVA program on Netbeans 7.1.1. In this program, I
> really need to call macro.txt. That's why I'm using the IJ library with the
> following part of code :
>
> String retval = "";
> retval = IJ.runMacroFile(script);
>
> When I do a print of "script", I get exactly the path+the name of the
> script.
>
> But here is my problem, it compiles without any problem but when I execute
> my program, I get this error :
>
> This plugin or macro requires ImageJ 1.41 or later.
>
> I really don't understand because I have the 1.47v version of ImageJ
> installed on my computer. So, it should work ? To give you more
> information,
> I use the 1.6.0_20 (64-bit) version JAVA and Netbeans 7.1.1.
> (also, I'm working on Windows 7). When I change the name of the macro, with
> a wrong one, I get this error : Macro file not found
> I guess it means it's making a link with ImageJ ? Could you give me a clue
> to understand what happens ?
>
> I have also tested with the "runMacro" function, and in this case, I get
> this error :
>
> Undefined variable in line 1.
>
> <C> : \ Users \ xxx \ Documents \ ImageJ \ plugins \ xxxscript . txt
>
> But I don't understand because the macro exists at this place
>
> Can you help me please ?
>
>
> Thank you very much for all your advices !
>
>
> Nath
>
>
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/Call-an-ImageJ-macro-from-Netbeans-tp5009378.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Jerome Mutterer
CNRS - Institut de biologie moléculaire des plantes
 12, rue du Général Zimmer
67084 Strasbourg Cedex
T 0367155339
www.ibmp.cnrs.fr

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Call an ImageJ macro from Netbeans

nath02
Dear Jerome


Thank you for your rapid answer !

You were right. With and upgraded version of ij.jar, it works perfectly !


Thank you very much !!!


Nath