Sometimes during the phase of the development, we might need to import some External JAR to the Pentaho Kettle Code. Pentaho DI has a step like “User Defined Java Class” where we can use some part of the Java code. Though this step doesn’t allow you to do full scale Java development, but still you can use some java features like methods, imports, etc. For more you can Pentaho Wiki. Now suppose, you have to get some java methods imported from a third party jar/ external jar, you need to do some changes as below:
STEP I: Create a library folder
/design-tools/data-integration/ folder of your pentaho installation, create a folder named libext. We would use this folder for storing the external jars / third party jars.
STEP II: Configure
Inside the same directory as above, you would find a folder called launcher. Open that folder and there you would find a property file as
You need to add the above folder configuration to the classpath and libraries section of the code.
Note i have added
:../libext to the above file since i want Kettle to read the content from that file too.
STEP III: Restart Spoon
Once all the configurations are done, simply start/restart the spoon in order to reflect the changes done to the properties.
STEP IV: The meal is ready
Now simply open “User Defined Java Class” Step and you can easily use the import your new jar files. In the image below, my class is stored inside the package
Please feel to comment or suggest 🙂