0

** I'm trying to run the following code which has a weather api an is supposed to tell a weather of a selected location but i'm getting a following error?

**


Exception in thread "main" java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
    at net.aksingh.owmjapis.core.OWM.<init>(OWM.kt)
    at myCbot.main(myCbot.java:11)
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 2 more

** im getting error fro the following java code **

import net.aksingh.owmjapis.core.OWM;
import net.aksingh.owmjapis.api.APIException;
import net.aksingh.owmjapis.model.CurrentWeather;

public class myCbot {

    public static void main(String[] args) throws APIException {

        // declaring object of "OWM" class
        OWM owm = new OWM("some-api-key");

        // getting current weather data for the "London" city
        CurrentWeather cwd = owm.currentWeatherByCityName("London");

        // printing city name from the retrieved data
        System.out.println("City: " + cwd.getCityName());

        // printing the max./min. temperature
        System.out.println(
                "Temperature: " + cwd.getMainData().getTempMax() + "/" + cwd.getMainData().getTempMin() + "\'K");
    }
}
Ahmed
  • 3
  • 4
  • 1
    Sounds like you are missing some sort of dependency. Did you follow the exact steps outlined in the documentation? (where: that missing class points to kotlin things missing . See https://stackoverflow.com/questions/44197521/gradle-project-java-lang-noclassdeffounderror-kotlin-jvm-internal-intrinsics for example – GhostCat Apr 29 '21 at 11:49
  • And hint: API keys are personalized. NEVER EVER put such information out to the internet! – GhostCat Apr 29 '21 at 11:50
  • this is the dependency above – Ahmed Apr 29 '21 at 12:13
  • I guess then the documentation there is insufficient. The author probably has some things in his local setup that aren't part of the setup described in the documentation. I think you might be best of by directly contacting the author via that github project. – GhostCat Apr 29 '21 at 12:19
  • 1
    actually it was a missing dependency thanks – Ahmed Apr 29 '21 at 12:29

0 Answers0