Bonsoir,

Je veux exécuter une application externe dans mon application JAVA,j'essaye d'utiliser le code ci dessous
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.ProcessBuilder.Redirect;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
 *
 * @author ASUS
 */
public class rrcdecoder {
 String protocol;
   String msghexa;
   String line = "";
  //  public static void main(String[] args) throws IOException {
        final List<String> commands = new ArrayList<String>(); 
        public rrcdecoder (String p,String m)
        {protocol=p;
     msghexa=m;}
        public String getcomment() throws IOException{
               // msghexa="6c00502ac8434b908081008b4ab0";
        //protocol="RrcDl-DCCH";
        String messageId = null;
        String sens;
        if (protocol=="RrcDl-DCCH" )
                sens="4";
        else 
            sens="10";
 
commands.add("decoderplugincli.exe");
commands.add("--d");
commands.add("-s");
commands.add(msghexa);
commands.add("-f");
commands.add("textfullfield ");
commands.add("-k");
commands.add("0401f763 ");
commands.add("-o");
commands.add(sens);
 
 
Runtime runtime = Runtime.getRuntime();
final Process process = runtime.exec(new String[] { "C:\\gatodecoder-1.3.3\\exe",commands.toString()}) ;
 
// Consommation de la sortie standard de l'application externe dans un Thread separe
new Thread() {
	public void run() {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
 
			try {
				while((line = reader.readLine()) != null) {
					// Traitement du flux de sortie de l'application si besoin est
                                        System.out.println(line);
				}
			} finally {
				reader.close();
			}
		} catch(IOException ioe) {
			ioe.printStackTrace();
		}
	}
}.start();
 
new Thread() {
			public void run() {
				try {
					BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
					//String line = "";
					try {
						while((line = reader.readLine()) != null) {
							// Traitement du flux d'erreur de l'application si besoin est
							System.out.println(line);
						}
					} finally {
						reader.close();
					}
				} catch(IOException ioe) {
					ioe.printStackTrace();
				}
			}
		}.start();
	    return line;
}}
mais ça marche pas,prière de vous m'aider
Merci d'avance pour vos réponses
y'a une exception dans la ligne 47
Voici ce que m'affiche la console
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at java.lang.Runtime.exec(Runtime.java:620)
	at java.lang.Runtime.exec(Runtime.java:485)
	at rrcdecoder.getcomment(rrcdecoder.java:47)
	at Scena.tracerflow(Scena.java:249)
	at Fenetre3$ListListener.doInBackground(Fenetre3.java:845)
	at Fenetre3$ListListener.doInBackground(Fenetre3.java:784)
	at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at javax.swing.SwingWorker.run(SwingWorker.java:334)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: CreateProcess error=5, Accès refusé
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
	at java.lang.ProcessImpl.start(ProcessImpl.java:137)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 12 more
 
juil. 26, 2017 6:38:58 PM Scena tracerflow
GRAVE: null
java.io.IOException: Cannot run program "C:\gatodecoder-1.3.3\exe": CreateProcess error=5, Accès refusé
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at java.lang.Runtime.exec(Runtime.java:620)