I use the eclipse IDE and I just exported my project using the 'export-> Runnable Jar'. In my code, I downloaded a map using
URL map1url = this.getClass().getResource("map01.txt");
and later
inputmap = new File(map1url.getFile());
and then looked at my data with
Scanner sc = null;
try {
sc = new Scanner(inputmap);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
, map01.txt , , map01.txt. java -jar, , .
map01.txt , jar, , , , . java -jar, . ? ? map01.txt - , . , jar, . ,
URL url = this.getClass().getResource("myImage.gif");
try {
BufferedImage myImage = ImageIO.read(url);
} catch (IOException e) {
}
, ? , , ?