File access outside Netbeans
I have a program that I developed using Netbeans. I am new to Java and I think I may have incorrectly specified a file location. The program can find the file and load the data when run from inside Netbeans but when I double click the .jar file it cannot locate the file.
Here is the line for file access:
Scanner scanner = new Scanner(new File("./PDDFWERJ.L09"));
The file resides in the Bidit(my application name) directory. The jar file resides in the dist directory.
Bidit (maindirectory for program)
if I change the file access line to this:
Scanner scanner = new Scanner(new File("PDDFWERJ.L09"));
it still doesn't work from outside the IDE
And if I do this:
Scanner scanner = new Scanner(new File("C:\\Bidding\\PDDFWERJ.L09"));
and place the file in that directory it still doesn't work. Any help would be appreciated. I know this is very noob but I can't seem to find the answer in the netbeans forums or online tutorials.