I have a problem about maxmind API. I use some example to test. However, the runtime error "no main function public static void main(String[] args)"
I am confused that I have public static void main
already.
public class GetLocationExample {
public static void main(String[] args) {
try {
LookupService lookup = new LookupService("D:\\GeoLiteCity.dat\\GeoLiteCity.dat",LookupService.GEOIP_MEMORY_CACHE);
Location locationServices = lookup.getLocation("140.118.175.207");
System.out.println("# country code: " + locationServices.countryCode);
System.out.println("# country name: " + locationServices.countryName);
lookup.close();
}
catch (IOException e) {
System.out.println("IO Exception");
}
}
}