ImageIO inside jar file

后端 未结 1 676
不思量自难忘°
不思量自难忘° 2021-01-26 16:57

Okay so I\'m trying to make an API for my intro screen to be used across multiple games and I\'ve spent the last 5-6 hours trying to figure out this 1 problem.

Lets say t

1条回答
  •  梦毁少年i
    2021-01-26 17:21

    If you use Class.getResourceAsStream(path), the path must start with a / (otherwise it's considered as a path relative to the class package). If you use ClassLoader.getResourceAsStream(path), the path must NOT start with a /.

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