Can't open JAR file

Asked by Irene

Hi,
I try to open JAR file in Sikuli.
I tried:
openApp("java -jar c:\\Program Files (x86)\\Tabulka.jar")
and solution from Stack Overflow:
load("c:\\Program Files (x86)\\Tabulka.jar")
import subprocess
subprocess.call(['java', '-jar', 'Tabulka.jar'])

But neither of these works. There is no errors in log. Command run but JAR application does not start.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Karl
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

your problem surely is, that you have your jar file in the folder
c:\Program Files (x86)

which contains blanks, that have to be quoted.

The mentioned load command is useless for running jars (it only puts the jar on sys.path to be able to access contained .py stuff).

subprocess.call(['java', '-jar', 'c:\\Program Files (x86)\\Tabulka.jar'])
should work.

Revision history for this message
Irene (juicykstrow) said :
#3

Thank you, it works finally.
When I start application this way, why code (which is next in Sikuli) does not work? Application under test is launched, but test suite does not run.

Revision history for this message
Karl (k-d) said :
#4

From https://docs.python.org/2.7/library/subprocess.html#subprocess.call:
"***Wait for command to complete***, then return the returncode attribute."

Revision history for this message
Best Karl (k-d) said :
#5

You can use subprocess.Popen(['java', '-jar', 'c:\\Program Files (x86)\\Tabulka.jar'])

Revision history for this message
Irene (juicykstrow) said :
#6

Thanks Karl, that solved my question.