ReferenceError: "importPackage" is not defined in <eval>

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ReferenceError: "importPackage" is not defined in <eval>

astrofriend
Hi, sorry to disturb.

I have some problem with AIJ to run JAVA script. I'm not a JAVA developer but try to do JAVA scripts.

I get an error message when I try to run my script.

It happens already on the first line and I get this in the AIJ log window:
ReferenceError: "importPackage" is not defined in <eval> at line number 1

I have placed the script in the plugin directory.

These are the three first line in my script Input_test.js

importClass(Packages.ij.IJ);
importClass(Packages.ij.io.OpenDialog);
ij = Packages.ij;

It's a Windows10-64 bit computer and everything else with AIJ works, all my macros I have. It's not installed on the C drive. For me it looks like some security problem that Windows block. I have tried to run AIJ as administrator.

Any idea ?

/Lars

Lars
Homepage:
http://astrofriend.eu/
Reply | Threaded
Open this post in threaded view
|

Re: ReferenceError: "importPackage" is not defined in <eval>

karenacollins
Administrator
Hi Lars,

Unfortunately I don't have any experience writing JAVA script for AIJ or IJ. Does your script work under plain ImageJ? If not, there's probably a lot more experienced people on the ImageJ that might be able to help with your situation. Have you tried asking your question over there?

http://imagej.1557.x6.nabble.com

Karen

On 1/14/2020 9:32 AM, astrofriend [via AstroImageJ] wrote:
Hi, sorry to disturb.

I have some problem with AIJ to run JAVA script. I'm not a JAVA developer but try to do JAVA scripts.

I get an error message when I try to run my script.

It happens already on the first line and I get this in the AIJ log window:
ReferenceError: "importPackage" is not defined in <eval> at line number 1

I have placed the script in the plugin directory.

These are the three first line in my script Input_test.js

importClass(Packages.ij.IJ);
importClass(Packages.ij.io.OpenDialog);
ij = Packages.ij;

It's a Windows10-64 bit computer and everything else with AIJ works, all my macros I have. It's not installed on the C drive. For me it looks like some security problem that Windows block. I have tried to run AIJ as administrator.

Any idea ?

/Lars

Lars
Homepage:
http://astrofriend.eu/



If you reply to this email, your message will be added to the discussion below:
http://astroimagej.1065399.n5.nabble.com/ReferenceError-importPackage-is-not-defined-in-eval-tp1274.html
To start a new topic under AstroImageJ, email [hidden email]
To unsubscribe from AstroImageJ, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: ReferenceError: "importPackage" is not defined in <eval>

astrofriend
Hi Karen,
Thanks for answere. I didn't solve how to use JAVA script but I manage to do it with ordinary macro. But soon or later I need to understand how to write JAVA script.

My friend tested on ImageJ and then it worked, so maybe I have used some functions in the script that's not in AIJ.

/Lars
Lars
Homepage:
http://astrofriend.eu/
Reply | Threaded
Open this post in threaded view
|

Re: ReferenceError: "importPackage" is not defined in <eval>

karenacollins
Administrator
If it works in IJ, then it could be that the fairly old version of IJ that is used as the basis for AIJ did not support JAVA script. It's on my to-do list to update the underlying IJ version, but it's a fairly big job so it keeps getting delayed.

Karen

On 1/22/2020 3:21 AM, astrofriend [via AstroImageJ] wrote:
Hi Karen,
Thanks for answere. I didn't solve how to use JAVA script but I manage to do it with ordinary macro. But soon or later I need to understand how to write JAVA script.

My friend tested on ImageJ and then it worked, so maybe I have used some functions in the script that's not in AIJ.

/Lars
Lars
Homepage:
http://astrofriend.eu/



If you reply to this email, your message will be added to the discussion below:
http://astroimagej.1065399.n5.nabble.com/ReferenceError-importPackage-is-not-defined-in-eval-tp1274p1276.html
To start a new topic under AstroImageJ, email [hidden email]
To unsubscribe from AstroImageJ, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: ReferenceError: "importPackage" is not defined in <eval>

astrofriend
Hi Karen,
I really like AIJ because I can make my own functions and not only does that are implemented in the astro editing software. Earlier I used Matlab, but too slow and complicated to use.

Isn't it any way to have the IJ people permamently implement AIJ so it's always there when they update IJ ? Or have AIJ as a shell around IJ ?

But a lot of work I understand.

I'm develope my macro further to make it more user friendly, still work to be done until the new version is ready. It batch read Canon DSLR .cr2 files.

Here is the old version:
http://www.astrofriend.eu/astronomy/tutorials/tutorial-astroimagej/tutorial-aij-01-introduction.html

/Lars
Lars
Homepage:
http://astrofriend.eu/
Reply | Threaded
Open this post in threaded view
|

Re: ReferenceError: "importPackage" is not defined in <eval>

karenacollins
Administrator
Hi Lars,

Thanks for your kind comments. Both the IJ and AIJ developments are basically single developer volunteer efforts with significant contributions from generous other contributors from time to time. At this point I don't expect that the IJ lead would be interested in supporting the AIJ fork (which is an overlay onto to ImageJ). Since the TESS mission started, I don't have significant chunks of time available for AIJ development, but do try to keep up with what I can.

Please do keep developing your macro and posting it here. I can't support testing it, but I could add it to the menu system once it's stable if you think that is helpful, but accessing via the usually Macro functionality is probably just as good too.

Thanks for your support of AIJ!

Karen


On 1/25/2020 8:26 AM, astrofriend [via AstroImageJ] wrote:
Hi Karen,
I really like AIJ because I can make my own functions and not only does that are implemented in the astro editing software. Earlier I used Matlab, but too slow and complicated to use.

Isn't it any way to have the IJ people permamently implement AIJ so it's always there when they update IJ ? Or have AIJ as a shell around IJ ?

But a lot of work I understand.

I'm develope my macro further to make it more user friendly, still work to be done until the new version is ready. It batch read Canon DSLR .cr2 files.

Here is the old version:
http://www.astrofriend.eu/astronomy/tutorials/tutorial-astroimagej/tutorial-aij-01-introduction.html

/Lars
Lars
Homepage:
http://astrofriend.eu/



If you reply to this email, your message will be added to the discussion below:
http://astroimagej.1065399.n5.nabble.com/ReferenceError-importPackage-is-not-defined-in-eval-tp1274p1278.html
To start a new topic under AstroImageJ, email [hidden email]
To unsubscribe from AstroImageJ, click here.
NAML