xml FileNotFoundException using slick2D library in java

前端 未结 1 1168
刺人心
刺人心 2020-12-21 12:49
private ConfigurableEmitter emitter;

File xmlFile = new File(\"ressources/emitter.xml\");
emitter = ParticleIO.loadEmitter(xmlFile);

If I launch t

相关标签:
1条回答
  • 2020-12-21 13:18

    When you pack your project to JAR your resource don't live on disk, but are compressed into the JAR itself and you have to load as resource.
    There are a lot of guide on SO on how to load resource from JAR using ClassLoader.getResourceAsStrem() (follow this link)

    0 讨论(0)
提交回复
热议问题