I have an application developed using java , and the runnable jar is created which is working from the command line. To run the jar file , normally I used to open a command line from the folder where jar is placed. And to run the jar file, if the jar is placed in D:/ drive, then D:/>java -jar abc.jar will run the application
Now I want to run this jar file in a system , through jenkins pipeline.
The pipeline job is created. I want to know
Expected result
From Jenkins pipeline job -> Access and run a jar file kept in a specified folder
Or is there any other way of doing it to get the expected result?
Thank you for the support!!
You can use dir
to access the folder with the path where your jar
file is available.
// dir("<Your path where scripts are present>")
dir ("D://"){
// Execute your java file
bat "java -jar abc.jar"
}