Cannot run program “cd“: error=2, No such file or directory

The springboot project needs to execute linux commands to execute dataX programs
the initial code is:

String[] cmdArr = {"cd","/home/datax/bin/"};

The correct should be:

String[] cmdArr = {"/bin/sh", "-c", "cd","/home/datax/bin/"};

Read More: