# Add java simulation code in standalone bundle

**URL:** <https://community.gatling.io/t/add-java-simulation-code-in-standalone-bundle/7391>\
**Category:** Gatling (Open-Source)\
**Created:** [December 5, 2022, 4:04pm UTC](https://community.gatling.io/t/add-java-simulation-code-in-standalone-bundle/7391 "2022-12-05T16:04:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![saxenaj](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@saxenaj](https://community.gatling.io/u/saxenaj)\
**Post date:** [December 5, 2022, 4:04pm UTC](https://community.gatling.io/t/add-java-simulation-code-in-standalone-bundle/7391/1 "2022-12-05T16:04:55Z")

</div>

I have added a simulation code under simulations folder but while running gatling.bat, it is not detecting simulation which i added. When i select run local simulation, it is only detecting simulation which comes with gatling bundle distribution.  
How can i add a simulation file and run it using command line?

---

<div class="post-metadata">

**Author:** ![sbrevet](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sbrevet/32/830_2.png) [@sbrevet](https://community.gatling.io/u/sbrevet)\
**Post date:** [December 5, 2022, 4:10pm UTC](https://community.gatling.io/t/add-java-simulation-code-in-standalone-bundle/7391/2 "2022-12-05T16:10:21Z")

</div>

Hi @saxenaj,

Welcome aboard!

Please, help us to help you.

> [@saxenaj](#):
>
> I have added a simulation code under simulations folder

Which filename? which content?

> [@saxenaj](#):
>
> but while running gatling.bat

Did you check the output? Specifically about pathes (java path, and gatling home, to ensure that is the right one and not another installation that is started)

Cheers!

---

<div class="post-metadata">

**Author:** ![saxenaj](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@saxenaj](https://community.gatling.io/u/saxenaj)\
**Post date:** [December 5, 2022, 4:15pm UTC](https://community.gatling.io/t/add-java-simulation-code-in-standalone-bundle/7391/3 "2022-12-05T16:15:45Z")

</div>

I have added a file with name TestSimulation.java under \simulations\mypackage\TestSimulation.java. This file is just hitting a local endpoint url. I have run the same file using gradle plugin and able to run the simulation successfully. I have verified the path and able to run gatling.bat successfully as I run computerDatabaseSimulation and getting the expected results.

---

<div class="post-metadata">

**Author:** ![sbrevet](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sbrevet/32/830_2.png) [@sbrevet](https://community.gatling.io/u/sbrevet)\
**Post date:** [December 5, 2022, 5:05pm UTC](https://community.gatling.io/t/add-java-simulation-code-in-standalone-bundle/7391/4 "2022-12-05T17:05:08Z")

</div>

I don’t reproduce your issue.

Steps I tried:

- Download the latest bundle from [Gatling official Open Source site](https://gatling.io/open-source/).

- Unzip it

- Add a file under `gatling-charts-highcharts-bundle-3.8.4/user-files/simulations/mypackage/MySimulation.java` with content:

- Launch `bin/gatling.sh`

Output:

```auto
GATLING_HOME is set to /tmp/gatling-charts-highcharts-bundle-3.8.4
Do you want to run the simulation locally, on Gatling Enterprise, or just package it?
Type the number corresponding to your choice and press enter
[0] <Quit>
[1] Run the Simulation locally
[2] Package and upload the Simulation to Gatling Enterprise Cloud, and run it there
[3] Package the Simulation for Gatling Enterprise
[4] Show help and exit
1
Choose a simulation number:
     [0] computerdatabase.ComputerDatabaseSimulation
     [1] mypackage.MySimulation

```

As you can see, Gatling finds my new simulation.

I cannot test with windows (ie `gatling.bat`) because I don’t have any windows available.

Can you describe the steps you did (as explicit as I did)?

Question: why do you still use our bundle if you know how to use the gradle? Our bundle is mainly for people that don’t use or don’t know how to use a packager (sbt, gradle, maven).

Cheers!

---

<div class="post-metadata">

**Author:** ![saxenaj](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@saxenaj](https://community.gatling.io/u/saxenaj)\
**Post date:** [December 5, 2022, 6:04pm UTC](https://community.gatling.io/t/add-java-simulation-code-in-standalone-bundle/7391/5 "2022-12-05T18:04:04Z")

</div>

Thanks sbrevet. I followed the same steps and wondering why it was not working on my windows laptop. I deleted the target folder and run it again. It worked fine now. Thanks for your proactive responses and help.

---

<div class="post-metadata">

**Author:** ![sbrevet](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sbrevet/32/830_2.png) [@sbrevet](https://community.gatling.io/u/sbrevet)\
**Post date:** [December 5, 2022, 8:57pm UTC](https://community.gatling.io/t/add-java-simulation-code-in-standalone-bundle/7391/6 "2022-12-05T20:57:02Z")

</div>

Perhaps a permissions issue?

Happy to help!

Cheers!

---

<div class="post-metadata">

**Author:** ![sbrevet](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sbrevet/32/830_2.png) [@sbrevet](https://community.gatling.io/u/sbrevet)\
**Post date:** [December 5, 2022, 8:57pm UTC](https://community.gatling.io/t/add-java-simulation-code-in-standalone-bundle/7391/7 "2022-12-05T20:57:10Z")

</div>

Closed on December 5, 2022, 8:57pm UTC


