Small compiler issue within the Fiji script editor

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

Small compiler issue within the Fiji script editor

CARL Philippe (LBP)
Dear all/Johannes,

I very sincerely apologize in the case this is not the best place to post my
following text and that a bug report would have been better.

I just figured out that the Fiji Script editor is not anymore compiling a
java file when it is calling a library that is linked to the plugin.

In order to try to make myself a little bit clearer, let me try to describe
the problem with an example.

in the case you download the Radial Profile Extended plugin
(http://rsb.info.nih.gov/ij/plugins/radial-profile-ext.html) and then
explode the jar file
(http://rsb.info.nih.gov/ij/plugins/download/jars/Radial_Profile_Angle_Ext.j
ar) in a folder, you end up with a multi_plot folder (containing an
extension of the Plot classes) and the Radial_Profile_Angle_Ext .java and
.class (as well as the plugins.config) files.

And if you then try to Run the Radial_Profile_Angle_Ext .java file from a
Fiji Script editor window you get the following error:

Radial_Profile_Angle_Ext.java:18: package multi_plot does not exist

import multi_plot.*;

As the same file compiled through the Plugins->Compile_and_Run… feature is
compiling right.

Am I doing something wrong?

Should I change something within the code so this is still working (as I was
still developing code in the same way with success some weeks ago).

I thank you very much in advance for your help and/or suggestions.

My best regards,

Philippe

 

Philippe CARL

Laboratoire de Biophotonique et Pharmacologie

UMR 7213 CNRS - Université de Strasbourg

Faculté de Pharmacie

74 route du Rhin

67401 ILLKIRCH

Tel : +33(0)3 68 85 41 84

 


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

Re: Small compiler issue within the Fiji script editor

ctrueden
Hi Philippe,

> Radial_Profile_Angle_Ext.java:18: package multi_plot does not exist

I cannot reproduce the problem you describe. After unpacking the JAR file
into my ImageJ's plugins folder, the following BeanShell works in my Script
Editor:

import multi_plot.*;
print(MultyPlotExt.class.getName());

Possibly, this issue was addressed since you wrote the mail. Or else there
is something different in the steps we followed. If you still have this
problem, please file a bug report using Help > Report a Bug -- it will
report exact details of your ImageJ installation including OS, plugin
versions, etc.

Another possibility is that you made changes to the multi_plot code and
then they were not reflected when executing code from the Script Editor
until after ImageJ was restarted? If so, that is an issue I have seen
recently: there are some class loading quirks right now with classes
present in the jars or plugins folder which getting repeatedly recompiled
without restarting ImageJ. If you could isolate a minimal, complete,
verifiable example (MCVE), it would be much appreciated!

> I was still developing code in the same way with success some weeks
> ago

I would encourage you to try developing plugins in an IDE, since there are
many advantages. Once you become proficient with the software it is much
faster, with many powerful debugging tools. See:

https://github.com/imagej/minimal-ij1-plugin
https://www.youtube.com/watch?v=Ac-6gJ2eRb0
http://imagej.net/Debugging#Attaching_to_ImageJ_instances
http://imagej.net/Maven

These resources are far from perfect, but hopefully they help get you
started.

Regards,
Curtis


On Fri, Aug 8, 2014 at 8:23 AM, Philippe CARL <[hidden email]>
wrote:

> Dear all/Johannes,
>
> I very sincerely apologize in the case this is not the best place to post
> my
> following text and that a bug report would have been better.
>
> I just figured out that the Fiji Script editor is not anymore compiling a
> java file when it is calling a library that is linked to the plugin.
>
> In order to try to make myself a little bit clearer, let me try to describe
> the problem with an example.
>
> in the case you download the Radial Profile Extended plugin
> (http://rsb.info.nih.gov/ij/plugins/radial-profile-ext.html) and then
> explode the jar file
> (
> http://rsb.info.nih.gov/ij/plugins/download/jars/Radial_Profile_Angle_Ext.j
> ar) in a folder, you end up with a multi_plot folder (containing an
> extension of the Plot classes) and the Radial_Profile_Angle_Ext .java and
> .class (as well as the plugins.config) files.
>
> And if you then try to Run the Radial_Profile_Angle_Ext .java file from a
> Fiji Script editor window you get the following error:
>
> Radial_Profile_Angle_Ext.java:18: package multi_plot does not exist
>
> import multi_plot.*;
>
> As the same file compiled through the Plugins->Compile_and_Run… feature is
> compiling right.
>
> Am I doing something wrong?
>
> Should I change something within the code so this is still working (as I
> was
> still developing code in the same way with success some weeks ago).
>
> I thank you very much in advance for your help and/or suggestions.
>
> My best regards,
>
> Philippe
>
>
>
> Philippe CARL
>
> Laboratoire de Biophotonique et Pharmacologie
>
> UMR 7213 CNRS - Université de Strasbourg
>
> Faculté de Pharmacie
>
> 74 route du Rhin
>
> 67401 ILLKIRCH
>
> Tel : +33(0)3 68 85 41 84
>
>
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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

Re: Small compiler issue within the Fiji script editor

CARL Philippe (LBP)
Dear Curtis,
I will try to adress all your comments and hope not to forget some of your points.
So first I still have the same problem and I get the following error message:

Started Radial_Profile_Angle_Ext.java at Mon Aug 25 14:12:15 CEST 2014
Compiling 1 file in C:\Users\Ph-K\AppData\Local\Temp\java8197273006779848693
C:\Users\Ph-K\AppData\Local\Temp\java8197273006779848693\src\main\java\Radial_Profile_Angle_Ext.java:59: cannot access MultyPlotExt
bad class file: RegularFileObject[C:\Work\SOFTWA~1\Fiji\plugins\Radial2\multi_plot\MultyPlotExt.class]
class file contains wrong class: multi_plot.MultyPlotExt
Please remove or make sure it appears in the correct subdirectory of the classpath.
        MultyPlotExt plot;
        ^
org.scijava.minimaven.JavaCompiler$CompileError: Compile error: 1
        at org.scijava.minimaven.JavaCompiler.call(JavaCompiler.java:80)
        at org.scijava.minimaven.MavenProject.build(MavenProject.java:477)
        at org.scijava.minimaven.MavenProject.build(MavenProject.java:406)
        at org.scijava.minimaven.MavenProject.build(MavenProject.java:391)
        at org.scijava.plugins.scripting.java.JavaEngine.eval(JavaEngine.java:154)
        at org.scijava.script.ScriptModule.run(ScriptModule.java:175)
        at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
        at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
        at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
        at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:164)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

Then following the advice of Wayne (it was through a private E-mailing) I had filed in a bug report about this issue one or two days after my first mail.

And by following your description of using the following BeanShell Script in the Editor:
import multi_plot.*;
print(MultyPlotExt.class.getName());
It works perfectly and I get actually the following output:
Started New_.bsh at Mon Aug 25 14:15:50 CEST 2014
multi_plot.MultyPlotExt

> Another possibility is that you made changes to the multi_plot code and then they were not reflected when executing code from the Script Editor until after ImageJ was restarted?

No, I didn't make any changes within the multi_plot code and started Fiji just before trying to compile the code.

> If you could isolate a minimal, complete, verifiable example (MCVE), it would be much appreciated!

I replayed from scratch the action I described in my first mail and it is still not working (and I have an up to date Fiji version).
I may have a hint why there is this problem (just an idea) which is the fact that the compiled files are generated within the following folder:
"C:\Users\Ph-K\AppData\Local\Temp\java8197273006779848693"
and not within the "Fiji\plugins" folder one.
This change came with an update I made (either of Fiji or Java) and is probably the issue, since it is maybe looking for a "C:\Users\Ph-K\AppData\Local\Temp\java8197273006779848693\multi_plot" folder and not a "Fiji\plugins\Radial\multi_plot" one.

I will look into your suggested IDE developing options.

My best regards,

Philippe

-----Message d'origine-----
De : ImageJ Interest Group [mailto:[hidden email]] De la part de Curtis Rueden
Envoyé : vendredi 22 août 2014 21:18
À : [hidden email]
Objet : Re: Small compiler issue within the Fiji script editor

Hi Philippe,

> Radial_Profile_Angle_Ext.java:18: package multi_plot does not exist

I cannot reproduce the problem you describe. After unpacking the JAR file into my ImageJ's plugins folder, the following BeanShell works in my Script
Editor:

import multi_plot.*;
print(MultyPlotExt.class.getName());

Possibly, this issue was addressed since you wrote the mail. Or else there is something different in the steps we followed. If you still have this problem, please file a bug report using Help > Report a Bug -- it will report exact details of your ImageJ installation including OS, plugin versions, etc.

Another possibility is that you made changes to the multi_plot code and then they were not reflected when executing code from the Script Editor until after ImageJ was restarted? If so, that is an issue I have seen
recently: there are some class loading quirks right now with classes present in the jars or plugins folder which getting repeatedly recompiled without restarting ImageJ. If you could isolate a minimal, complete, verifiable example (MCVE), it would be much appreciated!

> I was still developing code in the same way with success some weeks
> ago

I would encourage you to try developing plugins in an IDE, since there are many advantages. Once you become proficient with the software it is much faster, with many powerful debugging tools. See:

https://github.com/imagej/minimal-ij1-plugin
https://www.youtube.com/watch?v=Ac-6gJ2eRb0
http://imagej.net/Debugging#Attaching_to_ImageJ_instances
http://imagej.net/Maven

These resources are far from perfect, but hopefully they help get you started.

Regards,
Curtis


On Fri, Aug 8, 2014 at 8:23 AM, Philippe CARL <[hidden email]>
wrote:

> Dear all/Johannes,
>
> I very sincerely apologize in the case this is not the best place to
> post my following text and that a bug report would have been better.
>
> I just figured out that the Fiji Script editor is not anymore
> compiling a java file when it is calling a library that is linked to the plugin.
>
> In order to try to make myself a little bit clearer, let me try to
> describe the problem with an example.
>
> in the case you download the Radial Profile Extended plugin
> (http://rsb.info.nih.gov/ij/plugins/radial-profile-ext.html) and then
> explode the jar file (
> http://rsb.info.nih.gov/ij/plugins/download/jars/Radial_Profile_Angle_
> Ext.j
> ar) in a folder, you end up with a multi_plot folder (containing an
> extension of the Plot classes) and the Radial_Profile_Angle_Ext .java
> and .class (as well as the plugins.config) files.
>
> And if you then try to Run the Radial_Profile_Angle_Ext .java file
> from a Fiji Script editor window you get the following error:
>
> Radial_Profile_Angle_Ext.java:18: package multi_plot does not exist
>
> import multi_plot.*;
>
> As the same file compiled through the Plugins->Compile_and_Run…
> feature is compiling right.
>
> Am I doing something wrong?
>
> Should I change something within the code so this is still working (as
> I was still developing code in the same way with success some weeks
> ago).
>
> I thank you very much in advance for your help and/or suggestions.
>
> My best regards,
>
> Philippe
>
>
>
> Philippe CARL
>
> Laboratoire de Biophotonique et Pharmacologie
>
> UMR 7213 CNRS - Université de Strasbourg
>
> Faculté de Pharmacie
>
> 74 route du Rhin
>
> 67401 ILLKIRCH
>
> Tel : +33(0)3 68 85 41 84
>
>
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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

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