I use java 17 and okhttp-4.9.3. The call is:
OkHttpClient httpClient = new OkHttpClient.Builder().build();
Running the program, i get the exception:
Exception in thread "ReadStationsThread" java.lang.NoClassDefFoundError: okio/Buffer
at [email protected]/okhttp3.ResponseBody$Companion.create(ResponseBody.kt:248)
at [email protected]/okhttp3.ResponseBody$Companion.create$default(ResponseBody.kt:247)
at [email protected]/okhttp3.internal.Util.\<clinit\>(Util.kt:65)
The program can be build without error. I use gradle with these dependencies:
implementation ':okhttp-4.9.3'
implementation ':okio-3.3.0'
implementation ':okio-jvm-3.3.0'
implementation ':kotlin-stdlib-1.8.21'
in the module-info.java is these:
requires okhttp3;
requires okio;
requires kotlin.stdlib;
running the program, calls the exception. When i remove the mdule-info.java file, also running the program without modules, it works without problems. Anny idea what the module-info misses?