i am trying to export my project to .jar or .exe. This works fine expect for external text files.
Here my code:
InputStream is = new FileInputStream("MYPATH/start.txt");
Reader r = new InputStreamReader(is);
while ((my_char = r.read()) != -1) {
text_list.add(String.valueOf((char) my_char));
}
How do i have to set “MYPATH” so my jar-File works with text for other PCs?
Perhaps you are looking for
I wouldn’t try creating a List of all the bytes as Strings. Often reading a line at a time is more useful.