Unable to access Images inside executable jar

Asked by Prathima Lydia

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;
ImagePath.add(inJarFolder)
)

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

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Prathima Lydia
Solved:
Last query:
Last reply:
Revision history for this message
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
-Dsikuli.Debug=3
on the java command and evaluate the log

Revision history for this message
Prathima Lydia (prathimalydia) said :
#2

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