I solved the problem by using shell file. I wrote the command to start the selenium hub in .sh file. Then I did below stuff:
String cmd = "bash";
CommandLine cmdLine = new CommandLine(cmd);
cmdLine.addArgument("./src/main/resources/scripts/hub_start.sh");
cmdLine.addArgument(portNumber);
executor.execute(cmdLine);
Thus, I was able to execute the shell file and started selenium-hub.