TileManager.class.getResourceAsStream("maps/Level_0.json")
works fine if I compile everything, but when I put it in a jar, it returned
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/JsonDeserializer
My code for loading the JSON file is:
InputStream is = TileManager.class.getResourceAsStream(src);
assert is != null;
content = new BufferedReader(new InputStreamReader(is))
.lines().collect(Collectors.joining("\n"));
System.out.println(content);
data = Converter.fromJsonString(content);
Where
src
= "/maps/Level_0.json"
The location of `Level_0.json` is `src/res/maps/Level_0.json` and `res` is a source folder.
[x] I have imported all the libraries into the jar file.
I am using IntelliJ IDEA and /res is a source folder
What I have tried:
The location of `Level_0.json` is `src/res/maps/Level_0.json` and `res` is a source folder.
I have imported all the libraries into the jar file.
I have tried to change the path(with the preceding slash, without it)