How to include multiple runtime JAR files with a Job


There are two ways to include one or more JAR files with a Job:

  1. tLibraryLoad—Use a tLibraryLoad component to load a single JAR (or multiple JARs, using the Advanced settings tab), or
  2. Routine Libraries—Set a code routine as a dependency of your Job, and include libraries on that routine.


Problem Description

When running a Job, you may get one of the following errors:





For example:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/drill/exec/rpc/RpcException
at com.mapr.drill.core.DRJDBCConnection.connect(Unknown Source)
at com.mapr.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
at com.mapr.jdbc.common.AbstractDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(
at java.sql.DriverManager.getConnection(
at acme.drill_test_0_1.drill_test.tJDBCConnection_1Process(
at acme.drill_test_0_1.drill_test.runJobInTOS(



Job (an executable Java class) is not able to find a class in its classpath.





  1. Add a tLibraryLoad component to your Job.
  2. Select the first JAR file you need to load in the Library drop-down list (use the ... Browse selector if you need to).
  3. Click Advanced settings.
  4. Click the + (Add JAR) button and type the filename (not the full path) of the JAR you need to add, for example "sqljdbc42.jar". Note that you must use the double quotes.
  5. Repeat the above step for all the JAR files the Job needs.
  6. Run the Job.
  7. Studio will prompt you to locate/load all the required Jobs it cannot find.
  8. Studio will finish loading JAR files and will run the Job.




Routine Libraries

Right-click a routine you use in your Job and select Edit routine libraries, then add the JAR files you need.


Even if you do not use any routines in your Job, you can still use this method.

  1. Create a routine in Code > Routines called JarHolderRoutine (or any name you wish).
  2. Add the JAR files you need. The screenshot below shows the various popups you will see when adding a new JAR to your routine as a Routine Library.




  3. Link the routine to your Job:

    1. Close your Job.
    2. Right-click the Job, then select Setup routine dependencies.
    3. Click + to add the new JarHolderRoutine routine.
Version history
Revision #:
11 of 11
Last update:
‎04-04-2019 03:17 AM
Updated by:
Five Stars

This is fine only if you work alone. With many users with different workspaces sharing a git project both approaches won't work since the libraries are referenced by their local path which won't exists for other users.

So each user must download by itself the jars and put them manually into the right path. This is awful: possible mistakes in jar version, lot of manual work.. and even worse: by definying dependencies on a single routine/job if you develop new objects with same dependencies you must repeat the process of definying the dependencies.

Can you explain how to modify project or job pom files (or even routine pom which is hidden in studio) to edit maven dependencies and add jars as maven urls?

No clue on official docs to explain how to do It.

Also, can you explain how to add additional maven repositories to user_settings xml? With this approach I would like to build a project with all required dependencies and make users autonomous to install them, exactly ad described in pom.

Community Manager

Hi @pietro_tower,

Please ask your question on the appropriate Community discussion forum, as you'll get many more people to see it and provide answers.