'How to connect Java App with Virtual Machine and Run bash scripts

I need to connect my Java Application to Virtual Machine. After connecting I need to send String saved in my code to bash script, execute it, and then get the output of the script (it comes out in csv file), and then I need to compare it to another csv file that's in the code. I know how to compare it, but I don't know how to connect to Virtual Machine. I would be very happy if someone could help.

Basicly, I don't know how to connect to Virtual Machine with my Java App, any comment will help, should I use socket? If so, where to start?

Well, i tried to connect to VM with running proces but that didn't worked out. It's a corporate Vitrual Machine, that runs opperations for clients.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source