I have images folder under src folder(src/images). when i run program in eclipse, the program runs good but when i export runnable jar file and try to run this, i see error. I write in below:
java.io.FileNotFoundException: src\images\test2.bmp (The system cannot find the
path specified)
My program:
public class FirstSWTExample {
public static void main(String[] args) {
.
.
saveImage();
Image image=new Image(display, "src/images/test2.bmp");
shell.setImage(image);
}
public static void saveImage() {
String s="....";
byte[] dataCustImg = Base64.decode(s.getBytes());
try {
OutputStream stream = new FileOutputStream("src/images/test2.bmp");
stream.write(dataCustImg);
stream.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
I think jar file not found images folder. when i unzip jar file, the images folder not found. How can i solve my problem? i am beginner in java sorry if my question is easy.