[2.0.4] ImagePath.addJar() does not handle several calls

Asked by Jean Rebillat on 2021-01-04

----------------- tracked on GitHub
https://github.com/RaiMan/SikuliX1/issues/409
------------------------

I have a project where I use the Sikulix Java API (version 2.0.4) with JUnit 4.
I load dynamically the test jar to use from a GUI, thus all jars are not loaded at start but at run time in a separate URLClassLoader (same one for all tests).
I want to use the Imagepath.addJar() at each test jar loading to get the images for the current test, but only the first call to addJar() is taken into account, the next calls seems to be just ignored.

How may I load several jars containing image ressources in the ImagePath ? Or is it possible to wipe the currently loaded images jar to replace it by a new one ?

Note : As I only need the current test's jar, a reset() of the ImagePath before addJar() of the new current jar does the trick and refresh the images list. It is thus not urgent anymore for me, but I think there is something not normal with calling addJar() several times.

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2021-01-04
Last reply:
2021-01-20
Launchpad Janitor (janitor) said : #1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

RaiMan (raimund-hocke) said : #2

have to evaluate

Can you help with this problem?

Provide an answer of your own, or ask Jean Rebillat for more information if necessary.

To post a message you must log in.