java - Read and write file outside Jar -


i making first executable crossplatform jar file bunch of java files have. problem is, need read in values txt file outside file. working before, plop down said txt next .class file , call

javac myclass this.txt 

now doesn't work, , output expect right outside said class doesn't work either.

any ideas? thank you.

i found answer:

use file reader class, opposed using scanner file ala

scanner scan= new scanner(new file("foo.txt")); //doesn't work  scanner scan= new scanner(new filereader("foo.txt")); //does; 

thank you.


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -