Reputation: 31
I got this path .\\src\\aee\\user\\scorePercentage.csv
. It's running when I execute this in Netbeans. But when I created a jar file, the scorePercentage.csv
can't be found.
Upvotes: 2
Views: 900
Reputation: 2088
And working directory for a .jar file is /src
directory. you can represent resources by getClass().getResources(String);
Ex:getClass().getResources("/aee/user/scorePercentage.csv");
Upvotes: -1
Reputation: 19611
You should either export it to the directory from which the application is running, or use Class.getResource and embed it in the jar. If you use the src
directory anywhere in your code, you are doing something wrong.
Upvotes: 2