Unable to access Images inside executable jar

Asked by Prathima Lydia on 2020-05-25

I am using Eclipse IDE for development .

I am trying to make a executable jar and give it to others so that they can run it in their machine.

I have followed the below documentation to access the image files inside the jar

( https://sikulix-2014.readthedocs.io/en/latest/scripting.html#image-search-path-where-sikulix-looks-for-image-files

String clazz = "testAPI.Test";
String imgFolder = "/imgs";
String img = "test.png";
 String inJarFolder = clazz + imgFolder;

With the above steps mentioned in the doc , the executable jar works fine and is able to access the image files inside the executable jar , when it is executed from my computer( the computer where the code was developed ) .

when the same jar is executed in a different machine , it doesn't work.

But the same code when run in eclipse IDE in a different machine works well and is able to identify images.

I want this jar to be working in other machines too . How can we resolve this ?

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Prathima Lydia
Last query:
Last reply:
RaiMan (raimund-hocke) said : #1

Sure, that the image on the offending machine with the runnable jar cannot be located inside the jar or might they be not found on the screen?

when running the jar put
on the java command and evaluate the log

Prathima Lydia (prathimalydia) said : #2

The problem was a difference in resolution of the image in the other machine . This is resolved now