Luffyy123
Luffyy123

Reputation: 35

Modify information inside jar file

so my question is about programm written in java. I created sort of top 5 scores ranking using a text file for my game. It reads top scores, that are already saved in a text file, and when you finish the game, it writes to this text file, then reads it and updates top scores shown in the game. But now i'm stuck in packaging my game to a jar file. It seems impossible to modify a text file inside a jar file...

So what are possible solutions here? Forcing a programm to create new text file in a path where jar file is is one of the solutions, but maybe there is some easier solution that won't create additional file on a computer.

Upvotes: 1

Views: 38

Answers (1)

Caleb Loera
Caleb Loera

Reputation: 94

I would recommend having an external text file stored somewhere relative to your program. Then have your program modify it as it needs.

Upvotes: 1

Related Questions