I used
Runtime.getRuntime().exec(\"_____\")
but it throws a IOException as below:
IOException
java.io.IOException: Create
Put ant lib in you classpath ( project lib ) and run this code :
import org.apache.tools.ant.taskdefs.Execute; Execute exe = new Execute(); exe.setCommandline(new String[]{"java", "-version"}); exe.execute();