See if this works (sorry can’t test it right now)
Runtime.getRuntime().exec(new String[]{"php","/var/www/script.php", "-m", "2"});
More Related Contents:
- How to make pipes work with Runtime.exec()?
- Redirect Runtime.getRuntime().exec() output with System.setOut();
- Using Quotes within getRuntime().exec
- Java Array Parameter and Array Type Metot [closed]
- Does Java support default parameter values?
- What are the -Xms and -Xmx parameters when starting JVM?
- How do I run a batch file from my Java Application?
- Which overload will get selected for null in Java?
- Running Command Line in Java [duplicate]
- How to execute cmd commands via Java
- Difference between ProcessBuilder and Runtime.exec()
- Execute external program
- How to run Linux commands in Java?
- how to compile & run java program in another java program?
- Printing Runtime exec() OutputStream to console
- How to solve “java.io.IOException: error=12, Cannot allocate memory” calling Runtime#exec()?
- How to use “cd” command using Java runtime?
- Best practice for passing many arguments to method?
- How to pass parameters to JavaFX application?
- run shell command from java
- How to get the parameter names of an object’s constructors (reflection)? [duplicate]
- Start CMD by using ProcessBuilder
- Embed a 3rd-party JApplet in a Swing GUI & pass it parameters
- Proper usage of Java -D command-line parameters
- Java Runtime.getRuntime().exec() alternatives
- java Runtime.getRunTime().exec & wildcards?
- What is the “String args[]” parameter in the main method?
- Having a Column name as Input Parameter of a PreparedStatement
- Why can we use ‘this’ as an instance method parameter?
- How to use Pipe Symbol through exec in Java [duplicate]