I am trying to use a chess PGN parsing library to parse a PGN file and simply create a text file.
My maven project: https://github.com/divukman/chess_pgn_text/tree/master/pgntotext
Problem:
I can run it in IntelliJ (just run the main class) and it works.
If I create a fat jar (mvn package) and run it with java -jar target/pgn-to-text-1.0-SNAPSHOT.jar I get following error:
Exception in thread "main" com.github.bhlangonijr.chesslib.pgn.PgnException: Error parsing PGN[1, ]: at com.github.bhlangonijr.chesslib.pgn.PgnHolder.loadPgn(PgnHolder.java:343) at chess.Main.main(Main.java:18) Caused by: java.lang.NullPointerException at com.github.bhlangonijr.chesslib.pgn.PgnHolder.loadPgn(PgnHolder.java:206) ... 1 more
Any idea why it would work when running from the IDE and not when running from the jar? Why would it fail with null pointer exception? As if it did not read the file correctly!?!