Include OWM JAPIs as pure .jar/lib

Issue #5 resolved
Former user created an issue

Hello Ashutosh,

I'm trying to integrate your libs in .jar format into my Java project. Unfortunately I'm running non stop into error messages. Would you mind to help me to integrate your code as a library?

I'm using eclipse with a simple Java program. The .jar-files (compare a) are included as libraries. I'm calling your code from your homepage to make the api calls (compare b). When I try to run my program netBeans always prompts following message:

"Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics at net.aksingh.owmjapis.core.OWM.<init>(OWM.kt) at provider.WeatherProvider.<init>(WeatherProvider.java:25)

[...]

Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357)"

I've read about Maven and Koatlin but I don't want to integrate further dependencies instead I'm looking for simple integration of your API.

Could you please the error I'm making and how to fix it?

I'm thanking in advance!

a) https://bitbucket.org/aksinghnet/owm-japis/downloads/OWM%20JAPIs%20v2.5.2.2.zip b) Basic Example in "https://bitbucket.org/aksinghnet/owm-japis".

Comments (3)

  1. Ashutosh Kumar Singh repo owner

    Hi there,

    For this issue, I feel we're missing the dependencies - "kotlin-stdlib" or "kotlin-stdlib-jdk8" in this case. If I talk about the latest version (2.5.2.2), then you need to add these dependencies (as jars in your case) based on zip -> poms -> pom-default.xml:

    1. com.google.code.gson:gson:2.8.2
    2. com.squareup.retrofit2:retrofit:2.4.0
    3. com.squareup.retrofit2:converter-gson:2.4.0
    4. org.jetbrains.kotlin:kotlin-stdlib:1.2.30
    5. org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.30

    You can download them manually from Maven and use it in your project. Of course, this becomes a lot easy if you use a build tool like Ant, Maven, or Gradle. :)

    Thank you.

  2. Log in to comment