It\'s been quite a while since I\'m looking for but I don\'t find the solution. I\'m trying to execute bash command on Linux within .jar file. For that, I tried many things, in
I think the easiest way to do this would be to create a shell script (.sh extension) and then you can easily run that from within the Java program. There is a good answer on a previous question on how to run shell scripts within Java here.
To create a shell script you can use any text editor and create a file with the extension .sh and just enter the lines as you would in the bash terminal.