I want to run a jar file that has java code, inside the Pentaho spoon tool. This run is a single step by accepting an input, running the java class on top of this data and then providing the output somewhere. Is this possible with Pentaho Spoon?
Asked
Active
Viewed 2,533 times
2 Answers
3
This is very easy. Just pop the jar file into the lib directory with the other jars, and call it from the modified javascript step. ( Or maybe even the java class step if thats more suitable for what you're trying to do )
I've done this several times - most recently for some custom decoding which had to be done in java, and couldnt be done in the java step because janino didnt support it.

Codek
- 5,114
- 3
- 24
- 38
-
Hi codek , i am trying to execute a jar file from pentaho ETL .can you please look in to the following issue [link]http://forums.pentaho.com/showthread.php?155536-How-to-execute-jar-file-from-pentaho-ETL Thanks in advance Code – Surya Jan 02 '14 at 12:03
0
A different approach:
- leave the jar in your project directly, no copying necessary
- create a simple bash script "run.sh" in your project folder with "java -jar yourjar.jar" in it. you can also add that line directly within spoon and skip this step
- to your job, add a "execute shell script" and point to run.sh
done, the result code of the script determines success or not
why this way? I hate the way the api is documented, no code completion in spoon, Java or Javascript, this way you can write your code outside and rely on working systems

CaptainCrunch
- 1,230
- 14
- 15