In my java program I have a package called resources and there I reserve a log.ascii file where I save some details.To do so i use the method
.class.getResource("/resources")
everything works okay when i test it on eclipse but when i build the jar it won't find the path.Do you know how to overcome this problem?
Thank you for your time
private static String retrieveSelectedWorkspace() throws FileNotFoundException{
String temp[];
String str=Gui.class.getResource("/resources").toString();
temp=str.split("/",2);
FileReader fr = null;
fr = new FileReader(temp[1]+"/log.ascii");
Scanner scanner = new Scanner(fr);
while(scanner.hasNextLine())
return scanner.nextLine().toString();
return null;
}
}