Closed golokeshpatra45 closed 6 years ago
"it says yaml2json command not found" It looks like the system can not found that binary file.(May be $PATH in java is not the same as it in bash) You can use the absolute file path of the binary (like /usr/local/bin/yaml2json) to call it in java. You need to find the absolute file path of the binary in your system like /usr/local/bin/yaml2json. You need pass the input data stdin with java api,and get the output data from stdout with java api.
You can also try run bash in java like ("bash" ,"-c", "yaml2json < 1.yml > 2.json") or ("/bin/bash", "-c", "yaml2json < 1.yml > 2.json")
I do not try to run another proccess in java,but I had ran another process in golang.
following link may help: https://stackoverflow.com/a/13991171/1586797
Close for none-response after one year.
@bronze1man My Question is , when I am running it as bash (i.e from terminal ) yaml2json works fine. But when I run the same with the help of java , it says yaml2json command not found. Please help me out.