On Sat, Aug 30, 2014 at 11:17 AM, Melissa Cline <cline@soe.ucsc.edu> wrote:
Hi folks,
I'm attempting something that should be straightforward, but it's not. I have a tool that runs a JAR file, which I have bundled with the tool. I simply want to run the JAR file. And to paraphrase Thomas Edison, I've tried several thousand things that do not work (at least for me), from setting the JAVA_JAR_PATH environment variable in the tool_dependencies.xml file to trying to copy the JAR file into the tool-data/shared/jars subdirectories (which is the closest thing I've got to working). So, at long last I'm doing the sensible thing and looking for one simple working example that I can use as a template. Who can suggest a good toolshed tool (either main or test) that involves running its own JAR file, and that works?
Thanks!
Melissa
Here are a couple of my wrappers for Java tools, but I would suggest you invoke the Java script with an absolute path to the JAR file: $ java -jar ... Here is two examples done via a Python wrapper script (mainly used for pre or post processing the data files): https://github.com/peterjc/pico_galaxy/tree/master/tools/effectiveT3 https://github.com/peterjc/galaxy_blast/tree/master/tools/blast2go For EffectiveT3 which is open source and can therefore be easily redistributed, I set an environment variable EFFECTIVET3 for the location of the Jar file, which is used to invoke it via Java: $ java -jar ... For the Blast2GO wrapper, I require the person installing it setup an environment variable B2G4PIPE pointing at the folder with the JAR file. Older versions of this tool you be launched with the same -jar approach, but the current release requires setting a class path instead: $ java -cp ... I hope that helps, if not there are bound to be other Java examples in the ToolShed. Peter