ToponymSearchCriteria searchCriteria = new ToponymSearchCriteria();
searchCriteria.setQ("zurich");
ToponymSearchResult searchResult = WebService.search(searchCriteria);
for (Toponym toponym : searchResult.getToponyms()) {
System.out.println(toponym.getName()+" "+ toponym.getCountryName());
}
i get error :
Exception in thread "main" java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder
at org.geonames.WebService.search(Unknown Source)
at GeonameMain.main(GeonameMain.java:16)
Can anyone please help me in resolving this error??
I have added the geonames-0.5.jar.
but yet it is giving this error when i try to run the code.
You need to put the jar file for jdom in your classpath.
You can download it from here (see in the section "requirements")
http://www.geonames.org/source-code/