← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #686062]: [2.0.0] Maven project: images cannot be loaded using ...class.getResource("someImage.png") --- crashes with NPE

 

Question #686062 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/686062

syed ali posted a new comment:
Thanks for looking into this,
 i have a solution/workaround so i am not blocked.

instead of (which used to work in 1.1.3)
final Pattern FILE = new Pattern(Main.class.getResource("file.PNG"));

I tried this approach and it works
final Pattern FILE = new Pattern(AbstractClassTest.class.getClassLoader().getResource("file.PNG"));

Addition info:
AbstractClassTest is the class where i define all images.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.