Error when running the application outside the eclipse ide - it seems that java cannot find the image path

Thanks for help

Running through the eclipse, it runs perfectly. But at .jar

E:_projetos\bot-java-template-main\target>java -jar FirstBot-1.0-jar-with
at javax.swing.ImageIcon.(Unknown Source)
at dev.botcity.main.FirstBot.load(
at dev.botcity.main.FirstBot.(
at dev.botcity.main.FirstBot.main(

Hi @eduzortea ,

When you’re running your bot on Eclipse, the bot is looking for resources at:


In that folder are all images used by the bot to recognize UI elements.

However, when you build a runnable jar, the resource images are placed in the jar root. Use o zip extractor to check it.

Therefore you need to change your addImage() methods to addImage(“label”, “label.png”) without “/src/resources/”

1 Like