Hi,
I already read these 2 posts: http://imagej.588099.n2.nabble.com/ImageJ-and-NetBeans-td635868.html#a635869 and: http://imagej.588099.n2.nabble.com/How-to-link-an-external-package-to-plugin-in-ImageJ-td635887.html#a635890 Can you help me to compile and run plugins with netbeans? I'm not a beginner, but I've some difficulties using external .jar files with netbeans + imagej. Heres is my problem: I've some very complicated math algorithms in MATLAB. I successfully generated .jar files from the MATLAB code(by MATLAB built-in .jar builder) (I tested them using sample projects in netbeans). But now I want to write a plugin which uses this .jar file. I set up the netbeans project as described here: http://rsb.info.nih.gov/ij/developer/NBTutorial.html But when I want to run my plugin from ImageJ (started in debug mode by netbeans), than I get this error: "Plugin or class not found: My_plugin" (java.lang. NoClassDefFoundError: com/mathworks/toolbox/javabuilder/MWArray) So the main problem is, that in this ANT script structure I can't add external libraries to the project so that ImageJ sees it while running/debugging. Please help me! Any ideas? I also read, that user http://imagej.588099.n2.nabble.com/user/UserNodes.jtp?user=107784 has written a custom build.xml Can somebody send me that build.xml please to: [hidden email] Thank you very much! |
I use NetBeans to compile ImageJ plugins.
Once you have opened/begun a Project, click the Project tab in the left window. This shows a folder tree of all the folders associated with the project. Right click on the folder named Libraries and a pop-up menu will appear containing the options Add Project, Add Folder, Add JAR/Folder. Selecting "Add JAR/Folder" brings up a file open dialog from where you can add your jar file. Sean Parsons ________________________________ From: József Pálfalvi <[hidden email]> To: [hidden email] Sent: Wed, 18 August, 2010 16:05:35 Subject: netbeans and imagej Hi, I already read these 2 posts: http://imagej.588099.n2.nabble.com/ImageJ-and-NetBeans-td635868.html#a635869 and: http://imagej.588099.n2.nabble.com/How-to-link-an-external-package-to-plugin-in-ImageJ-td635887.html#a635890 Can you help me to compile and run plugins with netbeans? I'm not a beginner, but I've some difficulties using external .jar files with netbeans + imagej. Heres is my problem: I've some very complicated math algorithms in MATLAB. I successfully generated .jar files from the MATLAB code(by MATLAB built-in .jar builder) (I tested them using sample projects in netbeans). But now I want to write a plugin which uses this .jar file. I set up the netbeans project as described here: http://rsb.info.nih.gov/ij/developer/NBTutorial.html But when I want to run my plugin from ImageJ (started in debug mode by netbeans), than I get this error: "Plugin or class not found: My_plugin" (java.lang. NoClassDefFoundError: com/mathworks/toolbox/javabuilder/MWArray) So the main problem is, that in this ANT script structure I can't add external libraries to the project so that ImageJ sees it while running/debugging. Please help me! Any ideas? I also read, that user http://imagej.588099.n2.nabble.com/user/UserNodes.jtp?user=107784 has written a custom build.xml Can somebody send me that build.xml please to: [hidden email] Thank you very much! |
This doesn't happen, because there is no Libraries folder if you start the
project as described in the tutorial http://rsb.info.nih.gov/ij/developer/NBTutorial.html This is a free--form ANT project, and this is my main problem. The ANT script doesn't add these external jar files while compiling/building. How can I create a project, which starts ImageJ when debugging, and I can write and debug plugins too? So how should I create a project, which is similar to the one in http://rsb.info.nih.gov/ij/developer/NBTutorial.htmlbut I could add Libraries? Thanks for your reply! Joe 2010/8/18 Sean Parsons <[hidden email]> > I use NetBeans to compile ImageJ plugins. > > Once you have opened/begun a Project, click the Project tab in the left > window. > This shows a folder tree of all the folders associated with the project. > Right > click on the folder named Libraries and a pop-up menu will appear > containing the > options Add Project, Add Folder, Add JAR/Folder. Selecting "Add > JAR/Folder" brings up a file open dialog from where you can add your jar > file. > > Sean Parsons > > > > > > ________________________________ > From: József Pálfalvi <[hidden email]> > To: [hidden email] > Sent: Wed, 18 August, 2010 16:05:35 > Subject: netbeans and imagej > > Hi, > I already read these 2 posts: > > http://imagej.588099.n2.nabble.com/ImageJ-and-NetBeans-td635868.html#a635869 > and: > > http://imagej.588099.n2.nabble.com/How-to-link-an-external-package-to-plugin-in-ImageJ-td635887.html#a635890 > > > Can you help me to compile and run plugins with netbeans? > I'm not a beginner, but I've some difficulties using external .jar files > with netbeans + imagej. > Heres is my problem: I've some very complicated math algorithms in MATLAB. > I > successfully generated .jar files from the MATLAB code(by MATLAB built-in > .jar builder) (I tested them using sample projects in netbeans). > But now I want to write a plugin which uses this .jar file. I set up the > netbeans project as described here: > http://rsb.info.nih.gov/ij/developer/NBTutorial.html > > But when I want to run my plugin from ImageJ (started in debug mode by > netbeans), than I get this error: > "Plugin or class not found: My_plugin" > (java.lang. > NoClassDefFoundError: com/mathworks/toolbox/javabuilder/MWArray) > > So the main problem is, that in this ANT script structure I can't add > external libraries to the project so that ImageJ sees it while > running/debugging. > Please help me! Any ideas? > > I also read, that user > http://imagej.588099.n2.nabble.com/user/UserNodes.jtp?user=107784 has > written a custom build.xml > Can somebody send me that build.xml please to: [hidden email] > > Thank you very much! > > > > > |
In reply to this post by afro
Hi,
On Wed, 18 Aug 2010, József Pálfalvi wrote: > Can you help me to compile and run plugins with netbeans? I'm not a > beginner, but I've some difficulties using external .jar files with > netbeans + imagej. Heres is my problem: I've some very complicated math > algorithms in MATLAB. I successfully generated .jar files from the > MATLAB code(by MATLAB built-in .jar builder) (I tested them using sample > projects in netbeans). But now I want to write a plugin which uses this > .jar file. I set up the netbeans project as described here: > http://rsb.info.nih.gov/ij/developer/NBTutorial.html It would be nice to benefit from your work in the end. > But when I want to run my plugin from ImageJ (started in debug mode by > netbeans), than I get this error: > "Plugin or class not found: My_plugin" > (java.lang. > NoClassDefFoundError: com/mathworks/toolbox/javabuilder/MWArray) > > So the main problem is, that in this ANT script structure I can't add > external libraries to the project so that ImageJ sees it while > running/debugging. You could use the <unjar> tag. Please find an example here: http://www.java-tips.org/other-api-tips/ant/how-to-use-unjar-untar-unwar-unzip-task-2.html Hth, Johannes |
Hi,
On Thu, 19 Aug 2010, József Pálfalvi wrote: > Yeah, it would be nice, and I'm o it, but I can't solve it. This whole > thing is a bit messed up. > > If someone nows where this special build.xml (mentioned in > http://imagej.588099.n2.nabble.com/ImageJ-and-NetBeans-td635868.html#a635869) > is, it would be very helpful! I fear you'll have to do it yourself, but I cannot help but think that the <unjar> should solve your problem. You'll just have to unjar the Matlab-generated .jar into your own .jar together with the plugin classes. Of course, after that you will most likely run into environment variable issues with native libraries, but a custom start script should help that. > Do I really need to use free-form project as in the tutorial? Hasn't > someone managed to write plugins, and debug using simple project, and > somehow starting ImageJ from netbeans?? Oh, but people have managed to write plugins in Netbeans!!! What you try to do is a _very_ special case, though: you want to include Matlab-generated .jar files (which as far as I know still require a native component, so they are platform dependent). A quick workaround could be to copy the Matlab generated file into the plugins/ folder together with the .jar you generated with Netbeans. Hth, Johannes |
I know they managed writing scripts. And I don't think this is a very
special case... I explain my problem: I have my plugin as a .java class. I have one jar file (created earlier) with one method I want to call. In netbeans, when I build my project, and start it (ImageJ starts), I launch my plugin, but it can't find this .jar file. I tried to copy it everywhere, but it doesn't work. 2010/8/19 Johannes Schindelin <[hidden email]> > Hi, > > On Thu, 19 Aug 2010, József Pálfalvi wrote: > > > Yeah, it would be nice, and I'm o it, but I can't solve it. This whole > > thing is a bit messed up. > > > > If someone nows where this special build.xml (mentioned in > > > http://imagej.588099.n2.nabble.com/ImageJ-and-NetBeans-td635868.html#a635869 > ) > > is, it would be very helpful! > > I fear you'll have to do it yourself, but I cannot help but think that the > <unjar> should solve your problem. You'll just have to unjar the > Matlab-generated .jar into your own .jar together with the plugin classes. > > Of course, after that you will most likely run into environment variable > issues with native libraries, but a custom start script should help that. > > > Do I really need to use free-form project as in the tutorial? Hasn't > > someone managed to write plugins, and debug using simple project, and > > somehow starting ImageJ from netbeans?? > > Oh, but people have managed to write plugins in Netbeans!!! > > What you try to do is a _very_ special case, though: you want to include > Matlab-generated .jar files (which as far as I know still require a native > component, so they are platform dependent). > > A quick workaround could be to copy the Matlab generated file into the > plugins/ folder together with the .jar you generated with Netbeans. > > Hth, > Johannes > |
Hi,
On Thu, 19 Aug 2010, József Pálfalvi wrote: > I know they managed writing scripts. And I don't think this is a very > special case... > I explain my problem: > I have my plugin as a .java class. I have one jar file (created earlier) > with one method I want to call. > In netbeans, when I build my project, and start it (ImageJ starts), I launch > my plugin, but it can't find this .jar file. I tried to copy it everywhere, > but it doesn't work. Have you told your Netbeans project about the external library? I do not have a Netbeans installation to find out the exact menu path, but (from memory) it should be something like right click on the project, Properties>Libraries>Add single JAR... Hth, Johannes |
Of course. Actually free-form project doesn't have "Libraries" , it has
"Java Source Classpath". (Properties / Java Source Classpath / Add Jar/Folder) AND I added the jars to the Tools/Options/Miscellaneous/ANT/Classpath too. 2010/8/19 Johannes Schindelin <[hidden email]> > Hi, > > On Thu, 19 Aug 2010, József Pálfalvi wrote: > > > I know they managed writing scripts. And I don't think this is a very > > special case... > > I explain my problem: > > I have my plugin as a .java class. I have one jar file (created earlier) > > with one method I want to call. > > In netbeans, when I build my project, and start it (ImageJ starts), I > launch > > my plugin, but it can't find this .jar file. I tried to copy it > everywhere, > > but it doesn't work. > > Have you told your Netbeans project about the external library? I do not > have a Netbeans installation to find out the exact menu path, but (from > memory) it should be something like right click on the project, > Properties>Libraries>Add single JAR... > > Hth, > Johannes > |
In reply to this post by dscho
Interesting...
In the build.xml, if I uncomment the row <exclude name="plugins/**"/> then suddenly it can find those jar files (if I copy them manually to the source/plugins folder). But then I have to compile every plugin every time. 2010/8/19 Johannes Schindelin <[hidden email]> > Hi, > > On Thu, 19 Aug 2010, József Pálfalvi wrote: > > > I know they managed writing scripts. And I don't think this is a very > > special case... > > I explain my problem: > > I have my plugin as a .java class. I have one jar file (created earlier) > > with one method I want to call. > > In netbeans, when I build my project, and start it (ImageJ starts), I > launch > > my plugin, but it can't find this .jar file. I tried to copy it > everywhere, > > but it doesn't work. > > Have you told your Netbeans project about the external library? I do not > have a Netbeans installation to find out the exact menu path, but (from > memory) it should be something like right click on the project, > Properties>Libraries>Add single JAR... > > Hth, > Johannes > |
Does anyone know why http://rxtx.qbang.org/ seems to have disappeared,
when its coming back or where it has gone to? I was just about to start work on an ImageJ plugin that requires RS232 serial support and now the rxtx wiki site seems to have vanished? Does anyone know of an alternative location for the rxtx Java serial library? -- Michael Ellis |
Hi,
On Fri, 20 Aug 2010, [hidden email] wrote: > Does anyone know why http://rxtx.qbang.org/ seems to have disappeared, > when its coming back or where it has gone to? That website works for me. Will your plugin be Open Source? Ciao, Johannes |
In reply to this post by Michael Ellis
Works for me too. If you're sitll unable to access it for some reason, send
me an e-mail off list and I can send you the files you need from the site. Best Ben On Fri, Aug 20, 2010 at 3:25 AM, [hidden email] < [hidden email]> wrote: > Does anyone know why http://rxtx.qbang.org/ seems to have disappeared, > when its coming back or where it has gone to? > > I was just about to start work on an ImageJ plugin that requires RS232 > serial support and now the rxtx wiki site seems to have vanished? > > Does anyone know of an alternative location for the rxtx Java serial > library? > > -- Michael Ellis > |
Free forum by Nabble | Edit this page |