My RPG is doing just fine in the compiler. It inputs a file and reads it with Scanner, but when I export it into a ".jar" file it throws the FileNotFoundException.
I have tried putting the file in different locations. I have tried using different ways to call up the file. Nothing seems to be working.
package worldStuff;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class World {
public static String[][] initWorld(String[][]array,String name) throws FileNotFoundException {
int j = 0;
String string;
Scanner input = new Scanner(new File(name+".map"));
while(j!=30) {
string = input.nextLine();
array[j] = string.split(",");
j++;
}
input.close();
return array;
}
}
That is the method for inputting the file. I need a way for it to not error after compiling. I am using the Eclipse IDE with the export on this configuration: