java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -
i trying convert json java object use of gson in maven, following youtube video guidance - https://www.youtube.com/watch?v=vqgghm9pwe0 , theres error occurs when in main class error - package com.squareup.okhttp3 doesn't exist. code below:
java
package com.codebeasty.json; import com.squareup.okhttp3.okhttpclient; public class main { private static okhttpclient client = new okhttpclient(); public static void main (string [] args) { } }
i put in dependency in pom.xml:
<dependencies> <dependency> <groupid>com.squareup.okhttp3</groupid> <artifactid>okhttp</artifactid> <version>3.4.2</version> </dependency> <dependency> <groupid>com.google.code.gson</groupid> <artifactid>gson</artifactid> <version>2.8.0</version> </dependency> </dependencies>
i dont understand why doesn't recognize com.squareup. there may need download? have downloaded jar website - http://square.github.io/okhttp/ , tried building project dependencies. please :(
maven repo has latest version 3.4.1. trying changing version in pom or install downloaded in local using
mvn install:install-file -dfile=path/to/okhttp-3.4.2.jar -dgroupid=com.squareup.okhttp3 -dartifactid=okhttp -dversion=3.4.2 -dpackaging=jar
Comments
Post a Comment