I want to launch a program from the execution of my program in java. The command I use in the cmd would be changing user, password and url:
"start / B / D" c: \ Program Files (x86) \ Common Files \ Juniper Networks \ Integration "pulselauncher -u 'user' -p 'password' -url link -r pepe"
I get an error and I do not know how to try it, could you give me a cable? Thank you And the code I use is:
public static void abrirConexionPulseSecure() {
try {
String [] cmd = {
"start",
"/B",
"/D",
"\"c:\Program Files (x86)\Common Files\Juniper Networks\Integration\"",
"pulselauncher",
"-u",
USER,
"-p",
PASSWORD,
"-url",
"https://url.com",
"-r",
"pepe" };
Runtime.getRuntime().exec(cmd);
System.out.println("Conexion establecida.");
} catch (IOException e) {
e.printStackTrace();
}
}
And the error that I get is the following:
java.io.IOException: Cannot run program "start": CreateProcess error=2, El sistema no puede encontrar el archivo especificado
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at utils.ConexionBBDD.abrirConexionPulseSecure(ConexionBBDD.java:78)
at test.TestGestionFicheros.main(TestGestionFicheros.java:30)
Caused by: java.io.IOException: CreateProcess error=2, El sistema no puede encontrar el archivo especificado
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 5 more