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.