NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 855 - "Export as .jar" is now gone
"Export as .jar" is now gone
Status: RESOLVED WONTFIX
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
PC Windows
: P4 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2014-07-15 12:42 CDT by Romain
Modified: 2014-07-23 13:04 CDT
2 users (show)

See Also:

Description Romain 2014-07-15 12:42:18 CDT
While writing macros (ImageJ macro language), the "File > Export as .jar" is not available any longer.
This option is very useful to easily and simply create plugins.

Information about your version of Java:

  os.arch => amd64
  os.name => Windows 7
  os.version => 6.1
  java.version => 1.6.0_24
  java.vendor => Sun Microsystems Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_24-b07
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 19.1-b02
  java.vm.vendor => Sun Microsystems Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => sun.awt.Win32GraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => windows
  file.separator => \

The up-to-date check says: UP_TO_DATE

Information relevant to JAVA_HOME related problems:

  JAVA_HOME is set to: C:\Users\rfl30\Fiji.app/java/win64/jdk1.6.0_24//jre
  imagej.dir => C:\Users\rfl30\Fiji.app

Information about the version of each plugin:

Activated update sites:
ImageJ: http://update.imagej.net/ (last check:20140711230647)
Fiji: http://fiji.sc/update/ (last check:20140715010940)
Bio-Formats: http://sites.imagej.net/Bio-Formats/ (last check:20140715022639)

Files not up-to-date:
  d1a4ca7e (MODIFIED) 20140710133250 jars/ij-1.48s.jar
  0aec8732 (LOCAL_ONLY) 20140616110511 plugins/BatchColorTrafo_.jar
  f159eab2 (LOCAL_ONLY) 20140626091236 plugins/CaliFLIM_.jar
Comment 1 Johannes Schindelin 2014-07-22 15:16:56 CDT
As discussed on the mailing list, the File>Export as .jar command is only available for Java plugins; scripts should instead be installed into plugins/Scripts/<menu-path> (i.e. the Spirals macro was installed into plugins/Scripts/File/Open_Samples/Spirals_.ijm).
Comment 2 Romain 2014-07-23 03:39:54 CDT
Is there any particular reason why this option should not be available any longer?
Why removing if it works fine?

Others in the thread suggested that I file a bug so it could be fixed.
Comment 3 Johannes Schindelin 2014-07-23 09:39:11 CDT
> Is there any particular reason why this option should not be available any longer?

Yes. The way export .jar was implemented for scripts was tied very tightly to the Fiji scripting framework.

Now, the Fiji scripting framework was quite useful as a proof of concept for the SciJava scripting framework. It needed to be replaced by the latter, though, because we essentially were completely unable to enhance the former to our current needs, exemplified by the painful absence of R and Matlab bindings, something some collaborators of mine actually needed for *years*.

So there were pressing needs that demanded a better way to do things, which we now have: SciJava scripting.

> Why removing if it works fine?

It does not. It may work fine for your particular use case, but other researchers were limited too much.

And we have a powerful replacement: storing the scripts directly into plugins/Scripts/<menu-path>. This is not only much easier to understand, it also makes it much easier to collaborate on scripts, another good reason (demanded by collaborators of mine) why to abandon script-only .jar files.

Even better: this powerful replacement is part of ImageJ2, i.e. reaching more users than just Fiji users.

The original reason to make the (Fiji-only) hack was to allow installing scripts into arbitrary menus. Doing it via .jar files (the extension means "Java ARchive") worked, but it was papering over the real issue: we had to jump through hoops, calling a plugin that was not even included in the .jar file (and therefore might not even be present!) in order to execute a script.

We bought other problems by using this workaround, too: you could not use a common library of script functions because the script had no way to pull the library out of the same .jar file (because it was not there! And even if it was, the script had no idea how it was read and from where, making it impossible to discover library files in the same .jar file).

Now that we have a correct solution, i.e. a clean and simple way to install scripts and macros into arbitrary menus, there is no need for an ugly hack, even if it kinda worked for a long time.

Did that answer your questions?
Comment 4 Romain 2014-07-23 11:11:24 CDT
Johannes,
Thanks a lot for your thorough answer.
That answers my question.

Many thanks.
Comment 5 Romain 2014-07-23 11:25:29 CDT
Hi,
If I try and install my macro using Plugins > Install... I get the following warning:
WARNING: The PluginClassLoader cannot be reset

But it seems to work fine though.
Is it a problem?
Comment 6 Johannes Schindelin 2014-07-23 12:52:51 CDT
> If I try and install my macro using Plugins > Install...

Ah, that is meant for plugins, not scripts nor macros. For macros or scripts, just *copy* them into the place corresponding to the menu path.

Example: if you want to install an ImageJ 1.x macro into Edit>Options>Romain Cauk Options, you will have to make the directory Fiji.app/plugins/Scripts/Edit/Options/ and give it the file name Romain_Cauk_Options.ijm (the underscores will be replaced by spaces).

Of course, after that you will want to (re-)start Fiji.
Comment 7 Romain 2014-07-23 13:04:32 CDT
Ok that makes sense now !
Thanks.
It is misleading that when using Plugins>Instal..., the windows opening to select the plugin to save has the title: "Install Plugin, Macro or Script..."

Thanks for your help !