Check out example codes for "can i run script in ubuntu using java". It will help you in understanding the concepts better.

Code Example 1

String[] cmd = { "sh", "MyFile.sh", "\pathOfTheFile"};
    Runtime.getRuntime().exec(cmd);

Learn ReactJs, React Native from akashmittal.com