I have to write a Java Project with a Swing GUI and some smaller formal requirements like a button which does something or methods which implement something, very basic. I have written a programm with a basic GUI including a Jtable which stores information about students(name,semester...) in a Java File. The Problem is that the path of this java-File in my programm is relative, in my case:
public static final String pfad = "src/abgabe/";
public static final String name = "Uni";
File file = new File(pfad + name)
If I export my Programm to JAR and send it around, it wont work on other computers because only I have the Java File.
Can I change my code to make the Jar File creates a new Java file in its own root directory?