Run linux Script from Java
I have the following java code
ArrayList<String> argList = new ArrayList<>();
argList.add("Hello");
argList.add("World");
String[] args = argList.toArray(new String[argList.size()]);
Process p =Runtime.getRuntime().exec("echo '$1 $2' ", args);
result is $1 $2 but i want to print Hello World. Can anybody help me?
No comments:
Post a Comment