hello
in my java program I excecute a command through the code => it works
but as I stepped into the prog : I found myself with a command that requires an answer after his execution
then by java program: I do not know how to answer but in the command line I responds with yes and it works
do you have any idea how to respond through the java code
I hope you understand the question:
Here's the code I use for execute command DOS :
thank you in advancepublic static String importer_certificat(String alias,String nom_certi,String nom_keystore,String pass_keystore) { try{ String b = "keytool -import -alias "+alias+" -file "+nom_certi+" -keystore "+nom_keystore +" -storepass "+pass_keystore; System.out.println(b); Process p = Runtime.getRuntime().exec(b); BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); String inputLine, tous = ""; while ((inputLine = in.readLine()) != null) { tous += "\n"+inputLine; System.out.println(inputLine); } return tous; }catch(Exception e) { e.printStackTrace(); return e.getMessage(); } }