# Tweaking CLASSPATH for running test via gatling.sh

**URL:** <https://community.gatling.io/t/tweaking-classpath-for-running-test-via-gatling-sh/8722>\
**Category:** Gatling (Open-Source)\
**Created:** [February 13, 2024, 8:25am UTC](https://community.gatling.io/t/tweaking-classpath-for-running-test-via-gatling-sh/8722 "2024-02-13T08:25:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavel.marik](https://avatars.discourse-cdn.com/v4/letter/p/dec6dc/32.png) [@pavel.marik](https://community.gatling.io/u/pavel.marik)\
**Post date:** [February 13, 2024, 8:25am UTC](https://community.gatling.io/t/tweaking-classpath-for-running-test-via-gatling-sh/8722/1 "2024-02-13T08:25:44Z")

</div>

Hi  
I have a question regarding running tests that are packed into a JAR file. Specifically, I have a compiled test written in Java, which is packed into a file named `test.jar`. Now, I’m aiming to execute it using the `gatling.sh` script.

Previously, with Gatling version 3.7, the process was straightforward – just setting the `CLASSPATH` to point to the directory containing `test.jar` along with its dependencies sufficed. However, with the introduction of GatlingCLI in version 3.8, it seems this method no longer works. Upon examining the code, I came across the `OpenSourceRunCommand` class, where the classpath is constructed as follows:

```auto
val classPath = GatlingLibs ++ UserLibs ++ List(config.resourcesDirectory.toString) ++ GatlingConfFiles

```

So, if I understand correctly, is it now impossible to pass the classpath to Gatling? It seems the only viable option is to place `test.jar` into the `UserLibs` folder. Am I correct in assuming this? Is there no alternative method to run tests from a custom or user-defined folder? (I am aware of the -bf and -rsf options, but those only seemed to work when I placed the .class files there and were not effective with JARs.)

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [February 13, 2024, 8:31am UTC](https://community.gatling.io/t/tweaking-classpath-for-running-test-via-gatling-sh/8722/2 "2024-02-13T08:31:03Z")

</div>

Hi,

As of Gatling 3.10, you can add custom libs in `users-files/lib`.

However, please note that we’ll be killing this existing bundle and replace it with a standalone maven based one as of Gatling 3.11. See [Bundle: replace existing bundle with a maven wrapper one · Issue #4512 · gatling/gatling · GitHub](https://github.com/gatling/gatling/issues/4512).

We strongly recommend using a real build tool based project to bring extra libraries in the classpath.

Regards

---

<div class="post-metadata">

**Author:** ![GeMi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/gemi/32/939_2.png) [@GeMi](https://community.gatling.io/u/GeMi)\
**Post date:** [February 13, 2024, 6:38pm UTC](https://community.gatling.io/t/tweaking-classpath-for-running-test-via-gatling-sh/8722/3 "2024-02-13T18:38:46Z")

</div>

When you plan to release 3.11 ?

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/b/b148e0742de35c6280726cabf3ecd3de2d320f63.png) [@system](https://community.gatling.io/u/system)\
**Post date:** [March 14, 2024, 6:38pm UTC](https://community.gatling.io/t/tweaking-classpath-for-running-test-via-gatling-sh/8722/4 "2024-03-14T18:38:58Z")

</div>

Closed on March 14, 2024, 6:38pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
