Hi I want to execute this command from java code :
cd C:/Users/Amira/junoWorkspace/TestProjectUI
mvn -Dtest=MyClassTest.java test
So I found this method but i didn't find a way to adapt it to my case :
public static void main(String[] args) throws IOException
{
try
{
// Runtime runtime = Runtime.getRuntime();
String[] cmd={"C:\\WINDOWS\\System32\\cmd.exe","/C start test.bat"};
Process p = Runtime.getRuntime().exec(cmd);
// TODO code application logic here
}
catch(IOException e)
{
System.err.println("echec de l'execution du script: "+e);
System.exit(1);
}
}
Any idea ? Cheers