I'm struggling to reference a .dat file in my java project in Eclipse. My file structure looks like this:
I'm trying to reference 'GeoIPLite.dat' from my 'LookupCountry.java' file. When I say "Reference" I actually mean just getting a String object of the path and then sending that as a parameter to a class that is located under the 'Referenced Libraries' in a jar.
My code in LookupCountry.java is as follow:
try{
String dbFile = "../resources/GeoIPLite.dat"
// TRIED ALL THESE AS WELL:
//String dbFile = "/../resources/GeoIPLite.dat"
//String dbFile = "/resources/GeoIPLite.dat"
//String dbFile = "resources/GeoIPLite.dat"
//Some more code calling the jar file......
}catch(IOException e){
//Handles exception
}
So basically I get a IOException that gets thrown from the jar saying that the path to the .dat file is incorrect.
Any ideas??