JRuby plugin development (newbie)

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

JRuby plugin development (newbie)

intheclouds089
Hello,

As I know more Ruby than Java, I'd prefer to use it for plugin development.
Everything I've found so far were hints on how to make ImageJ JRuby-aware. Especially in Fiji, that's already integrated. However, I'd like to compile my plugin using jrubyc and use the resulting .class file.
Does anybody have experience in doing that and help me track down my problems?

Thanks,
Christian
Reply | Threaded
Open this post in threaded view
|

Re: JRuby plugin development (newbie)

dscho
Hi Christian,

On Fri, 4 Jun 2010, Christian Böhringer wrote:

> As I know more Ruby than Java, I'd prefer to use it for plugin
> development. Everything I've found so far were hints on how to make
> ImageJ JRuby-aware. Especially in Fiji, that's already integrated.
> However, I'd like to compile my plugin using jrubyc and use the
> resulting .class file. Does anybody have experience in doing that and
> help me track down my problems?

Interesting, I never tried that. What are the symptoms?

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|

Re: JRuby plugin development (newbie)

intheclouds089
Hello,

>> So far so good, I included jruby in the classpath and run "java -cp
>> jruby-complete.jar main", but that now results in:
>
> You need "java -cp jruby-complete.jar:. main" (or on Windows, "-cp
> jruby-complete.jar;.").

By doing so and setting the necessary classpaths in ImageJ, I end up with a plugin that doesn't give me any error messages - but does nothing at all when called. Imlementing the Plugin Interface didn't help either.
I'll keep on trying. Feeling optimistic now. :)

Thanks,
Christian
Reply | Threaded
Open this post in threaded view
|

Re: JRuby plugin development (newbie)

Albert Cardona-2
It may be easier to leave the jruby scripts as scripts inside the jar,
and then run them.
See for example how we do it with jython. Each jython script appears
as an ImageJ plugin, by defining an entry for it in the plugins.config
file of the jar:

http://pacific.mpi-cbg.de/wiki/index.php/Jython_Scripting#Distributing_jython_scripts_in_a_.jar_file

Albert

--
http://albert.rierol.net
Reply | Threaded
Open this post in threaded view
|

Re: JRuby plugin development (newbie)

dscho
In reply to this post by intheclouds089
Hi,

On Fri, 4 Jun 2010, Christian Böhringer wrote:

> >> So far so good, I included jruby in the classpath and run "java -cp
> >> jruby-complete.jar main", but that now results in:
> >
> > You need "java -cp jruby-complete.jar:. main" (or on Windows, "-cp
> > jruby-complete.jar;.").
>
> By doing so and setting the necessary classpaths in ImageJ, I end up
> with a plugin that doesn't give me any error messages - but does nothing
> at all when called. Imlementing the Plugin Interface didn't help either.

Can you send me a generated .class file of such an example implementing
the PlugIn interface? I would like to play with it.

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|

Re: JRuby plugin development (newbie)

dscho
Hi,

On Sun, 6 Jun 2010, Christian Böhringer wrote:

> Am 04.06.2010 um 23:47 schrieb Johannes Schindelin:
> >>> You need "java -cp jruby-complete.jar:. main" (or on Windows, "-cp
> >>> jruby-complete.jar;.").
> >>
> >> By doing so and setting the necessary classpaths in ImageJ, I end up
> >> with a plugin that doesn't give me any error messages - but does nothing
> >> at all when called. Imlementing the Plugin Interface didn't help either.
> >
> > Can you send me a generated .class file of such an example implementing
> > the PlugIn interface? I would like to play with it.
>
> Sure, thanks a lot!
This class seems to have a main() method, but does not implement PlugIn.

Ciao,
Johannes