Developing Tools With Java

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

Developing Tools With Java

Elie Freilich
Hello,

I just started working with developing a tool for Galaxy; I have been
programming it in Java. However, when it came time to implement my
tool into Galaxy, I was unable. When I try to run it normally, it
works. However, in Galaxy, when I try to use the JAR file, it produces
a java.lang.NoClassDefFoundError and a
java.lang.ClassNotFoundException.

As it seems rather meaningless to be setting a classpath in an
abstract framework like Galaxy, is there a simple way to run Java JAR
files? I tried a "-jar" argument, but I can't put in an argument
before the filename. Should I be using the ".class" files instead of
the JAR files? Should the format in the XML file be <command
interpreter="java"></command>?

Thanks so much,
Elie
_______________________________________________
galaxy-dev mailing list
[hidden email]
http://lists.bx.psu.edu/listinfo/galaxy-dev
Reply | Threaded
Open this post in threaded view
|

Re: Developing Tools With Java

Jesse Erdmann
Hi,

In the past, I've done something like this:

<command>
       #set $jar_dir = "/mydir/jars/"
       java -cp $jar_dir/my_jar.jar:$jar_dir/my_second_jar.jar
MyClass $input </command>

However, it looks like you can set a jar directory.  Here's the
relevant bit from a recent update:

4)
Add a jar directory / bin which is accessible to tool configurations
by specifying e.g. '${GALAXY_DATA_INDEX_DIR}/shared/jars/FOO.jar',
where FOO.jar is the desired jar which has been placed in / linked to
'GALAXY_ROOT/tool-data/shared/jars' (by default;
$GALAXY_DATA_INDEX_DIR can be configured to point elsewhere [value of
'tool_data_path' configuration variable in universe_wsgi.ini]).  The
setup.sh script has been modified to create this directory when not
present.

I haven't tried using this, so I'm not entirely sure how a tool would
use a jar in the shared directory.

On Fri, Jun 18, 2010 at 7:40 AM, Elie Freilich <[hidden email]> wrote:

> Hello,
>
> I just started working with developing a tool for Galaxy; I have been
> programming it in Java. However, when it came time to implement my
> tool into Galaxy, I was unable. When I try to run it normally, it
> works. However, in Galaxy, when I try to use the JAR file, it produces
> a java.lang.NoClassDefFoundError and a
> java.lang.ClassNotFoundException.
>
> As it seems rather meaningless to be setting a classpath in an
> abstract framework like Galaxy, is there a simple way to run Java JAR
> files? I tried a "-jar" argument, but I can't put in an argument
> before the filename. Should I be using the ".class" files instead of
> the JAR files? Should the format in the XML file be <command
> interpreter="java"></command>?
>
> Thanks so much,
> Elie
> _______________________________________________
> galaxy-dev mailing list
> [hidden email]
> http://lists.bx.psu.edu/listinfo/galaxy-dev
>



--
Jesse Erdmann
Bioinformatics Analyst
Masonic Cancer Center
University of Minnesota
[hidden email]
612-626-3123

[hidden email]
Twitter: http://twitter.com/jesseerdmann



--
Jesse Erdmann
Bioinformatics Analyst
Masonic Cancer Center
University of Minnesota
[hidden email]
612-626-3123

[hidden email]
Twitter: http://twitter.com/jesseerdmann

_______________________________________________
galaxy-dev mailing list
[hidden email]
http://lists.bx.psu.edu/listinfo/galaxy-dev