0

I´m trying to create JAR from IntelliJ project including some external libraries. Finally, I´ve managed to get JAR working in IntelliJ - the whole application loads and works perfectly. When I try to open it from the file, I get only a blank window opening.

I´ve tried every manual and tutorial I found here, on youtube and all over the internet but noone seems to have the same issue. Any help will be much appreciated! This is how the Project Structure section looks like Project Structure

SOLVED with InputStream is = getClass().getResourceAsStream("clock.png");

the only way textures will load in JAR.

Lenka
  • 13
  • 6
  • Start the JAR from cmd (`java -jar `). Are there any Exceptions? E.g. ClassNotFoundException? – dan1st May 24 '19 at 17:49
  • Please see https://stackoverflow.com/a/42200519/104891, https://stackoverflow.com/a/42660624/104891 and https://stackoverflow.com/a/54894502/104891. – CrazyCoder May 24 '19 at 18:28
  • Thanks, both of you! I really helped! I saw the solutions before, but the dots only connected when @dan1st pointed me in the direction to find what´s wrong. If if would be any help for someone in the future, the textures need to be loaded this way InputStream is = getClass().getResourceAsStream("clock.png"). Nothing else works with JAR. – Lenka May 24 '19 at 22:10

0 Answers0