title: Retrofit2, maven project, Illegal reflective access warning
body: <p>I just started a new maven project and did a simple implementation of the Retrofit client. I'm getting the following warnings:</p>
  
  <pre><code>WARNING: An illegal reflective access operation has occurred
  WARNING: Illegal reflective access by retrofit2.Platform (file:/C:/Users/Admin/.m2/repository/com/squareup/retrofit2/retrofit/2.8.1/retrofit-2.8.1.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
  WARNING: Please consider reporting this to the maintainers of retrofit2.Platform
  WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
  WARNING: All illegal access operations will be denied in a future release
  Process finished with exit code 0
  </code></pre>
  
  <p>here is the code</p>
  
  <pre><code>import retrofit2.Retrofit;
  import retrofit2.SimpleXmlConverterFactory;
  import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
  
  public class RetrofitClient {
  
      private static Retrofit retrofit = null;
      private RetrofitClient() { }
  
      public static EndPoints getAPI(String baseUrl) {
          if (retrofit == null) {
              retrofit = new Retrofit.Builder()
                      .baseUrl(baseUrl)
                      .addConverterFactory(SimpleXmlConverterFactory.create())
                      .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                      .build();
          }
          return retrofit.create(EndPoints.class);
      }
  }
  </code></pre>
  
  <p>Interface is simply</p>
  
  <pre><code>import retrofit2.Call;
  import retrofit2.http.GET;
  
  public interface EndPoints {
      @GET("teststatuses")
      Call&lt;String&gt; testStatus();
  }
  </code></pre>
  
  <p>Call looks like this:</p>
  
  <pre><code>EndPoints endPoints = RetrofitClient.getAPI("http://localhost:8080/");
  Call&lt;String&gt; repos = endPoints.testStatus();
  System.out.println(repos.execute());
  </code></pre>
  
  <p>The project runs java language level 11 with SDK 11</p>