Opening jar file from Sikuli java

Asked by Anton on 2017-05-04

Hi ,

I want to run a jar file through script of sikuli java.

I tried to open the jar file by doing the following script.

String path="C:\\git\\OriginalBuild\\Build.jar";
App.open(path);

i get this error in the log when I try to execute the above script

[error] [error] App.open failed: C:\git\OriginalBuild\Build.jar not found

Thanks in advance

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2017-05-04
Last query:
2017-05-04
Last reply:
2017-05-04
Best RaiMan (raimund-hocke) said : #1

have you tried with a java command from command line?

java -jar C:\git\OriginalBuild\Build.jar

if this works, then issue this command via python subprocess.

Anton (antongregory) said : #2

Thanks for answering.

I tried using

String path="C:\\git\\OriginalBuild\\Build.jar";
ProcessBuilder pb = new ProcessBuilder("java", "-jar", path);

  try {
   Process p = pb.start();
  }
catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }

Anton (antongregory) said : #3

Thanks RaiMan, that solved my question.