Creating Jar File:
In my previous post, i discussed how to create Bat file to run the script from Command prompt using Java commands.
Another popular way (as mentioned in that post) is by packaging the script (java program) into Jar and running the jar from bat file. If you are working on CI/CD project, this will help you to run the script by triggering the bat file from Jenkins job.
From your eclipse IDE, you can select File –> Export, Select Runnable Jar File

This is important step, here you need to mention the package name in “Launch configuration:” where the Java Main Class is located. This will be used by eclipse to update Manifest file accordingly.

Once done, you will see the Jar file in the location you selected above.
Creating the batch file:
Make sure your jar is inside project root.
Open a notepad, write the below details (by updating the location where your project folder is present) and save it with “.bat” extension
</pre> cd C:\Selenium\ java -jar Test.jar <pre>