Skip to main content

Images in jar Files

3 replies [Last post]
riepi
Offline
Joined: 2008-03-27

Hello,
i need a .jar package from my program to create an .exe with JMooth. When i build my project in netbeans i find the jar in the dist folder but when i click this jar file my program starts without loading images. Every image gets an url in this kind:
imageUrl: "{__DIR__}/images/unknown.png"
All images are in my jar file. What is wrong?

riepi

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
riepi
Offline
Joined: 2008-03-27

That's it,
thank you very much

alexsch
Offline
Joined: 2007-07-12

It is a known issue: JFXC-1805 "{__DIR__}/duke.png" path does not work in jar file
http://openjfx.java.sun.com/jira/browse/JFXC-1805

michael_heinrichs
Offline
Joined: 2007-11-15

Print the string, which you use for the URL and you will probably see the problem. I think you have to remove the slash between "{__DIR__}" and "images".