Check out example codes for "Java code to launch shell script with arguments". It will help you in understanding the concepts better.

Code Example 1

String cmd= "./copyFile.sh file1Name file2Name" ; // Path to Script and paramters $1 $2 used inside the script
ProcessBuilder pb = new ProcessBuilder(cmd. split(" ")); 
Process pr = pb.start();

Learn ReactJs, React Native from akashmittal.com