title: Retrofit2 java.lang.NoClassDefFoundError: okhttp3/Call$Factory in JAVA
body: <blockquote>
    <p>I am not developing a Android Application ,  <br/>
    I'm just writing some JAVA codes to support Imgur API services.</p>
  </blockquote>
  
  <pre><code>public interface ImgurAPI {
      String server = "https://api.imgur.com";
      String BASE64 = "base64";
  
      @POST("/3/upload")
      void postImage(
              @Header("Authorization") String auth,
              @Query("title") String title,
              @Query("description") String description,
              @Query("type") String type,
              @Body String base64Image,
              Callback&lt;ImageResponse&gt; cb
      );
  </code></pre>
  
  <p>}</p>
  
  <p>Main : </p>
  
  <pre><code>public static void main(String[] args) {
  
      try{
          Retrofit retrofit = new Retrofit.Builder()
                  .baseUrl(ImgurAPI.server)
                  .build();
          ImgurAPI myAPI = retrofit.create(ImgurAPI.class);
          String base64Image = new ImageReader(PATH).getBase64String();
          myAPI.postImage(AUTH, "Hi", "Test", ImgurAPI.BASE64, base64Image, new MyCallBack());
  
      }catch(Exception err){
          err.printStackTrace();
      }
  }
  </code></pre>
  
  <p>and the exception throwing : </p>
  
  <pre><code>    Exception in thread "main" java.lang.NoClassDefFoundError: okhttp3/Call$Factory
      at Main.main(Main.java:14)
  
  Caused by: java.lang.ClassNotFoundException: okhttp3.Call$Factory
  </code></pre>
  
  <p>I found out lots of solutions of Android.
  So I'm wondering if Retrofit available in <strong>only JAVA</strong>. <br/>
  thanks . </p>