My project is not very advanced cause I've just started programming in Java/JavaFX.
Users select country from combobox, then below in text field write a city. After pressing OK button user should receive a weather forecast for one day for the city entered. Actually names are getting correctly from inputs and sets as private fields in Weather class. I'm using weather OWM JAPIs from: https://bitbucket.org/aksinghnet/owm-japis/src. All needed libraries are added to project. (I've read that better way is to use Maven/Gradle frameworks but i'm totally green in using them).
Problem appears when method showCurrentWeather from Weather class is launched. New created object owm in line 19 causes lot of errors f.e:
Caused by: java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
at net.aksingh.owmjapis.core.OWM.<init>(OWM.kt)
at sample.Weather.showCurrentWeather(Weather.java:19)
at sample.Controller.searchWeather(Controller.java:30)
Weather class:
public void showCurrentWeather() throws APIException {
OWM owm = new OWM(MyConstants.OWM_API_KEY);
CurrentWeather cwd = owm.currentWeatherByCityName(city);
System.out.println("City: " + cwd.getCityName());
System.out.println("Temperature: " + cwd.getMainData().getTempMax()
+ "/" + cwd.getMainData().getTempMin() + "\'K");
}
Controller class
public void searchWeather() throws APIException {
String selectedCountry = comboBox1.getSelectionModel().getSelectedItem().toString();
String selectedCity = textField1.getText();
Weather weather = new Weather(selectedCity,selectedCountry);
weather.showCurrentWeather();
}
Any answer/advice is really appreciated.