à tous ,
J'aimerais lancer une image qui est sur mon disque dur avec une application java , j'ai essayer sa sur Linux :
String workingDir = System.getProperty("user.dir");
String file=workingDir+File.separator+fileName ;
Runtime runtime=Runtime.getRuntime();
Process pr=null;
try
{
pr = runtime.exec(file);
} catch(Exception err) {}
Sur windows , sa marché mais avec le code suivant :
String workingDir = System.getProperty("user.dir");
String file = workingDir + File.separator + fileName;
String [] commands = { "cmd.exe" , "/c", "start" , "\"DummyTitle\"", "\"" + file + "\"" };
Process pr = Runtime.getRuntime().exec(commands);
Quelqu'un s'y connait ???