Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Okhttp3 com.square does not exist

I am using Netbeans and I've created java project with Maven. I added this dependency.

 <dependency>
    <groupId>com.squareup.okhttp</groupId>
    <artifactId>okhttp</artifactId>
    <version>2.7.2</version>
</dependency>

It worked, I could import com.squareup.okhttp.*. After seeing some code on the web I realized that many people are using the version 3+. I tried to change the package to:

updated I've typed groupid wrongly in the question "com.squareup.okhttp" but in my code it was right "com.squareup.okhttp3".

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.9.0</version>

But I couldn't import com.squareup.okhttp3 ( package com.squareup does not exist). Why? I am new to the Java language itself and all the IDEs and tools that support it.

like image 735
Diego Alves Avatar asked Sep 14 '25 09:09

Diego Alves


1 Answers

The import is just okhttp3: "import okhttp3" without com.square.

like image 175
Diego Alves Avatar answered Sep 15 '25 22:09

Diego Alves