title: The type java.time.Duration cannot be resolved when using OkHttpClient v3.12.x on Java 7
body: <p>I'm developing for a project which is compiled for Java 7.</p>
  <p>In this project I use OkHttpClient v3.12.13, which is compatible for Java 7 (as stated <a href="https://square.github.io/okhttp/#requirements" rel="nofollow noreferrer">here</a>). However these lines produces an error in the Eclipse editor:</p>
  <pre class="lang-java prettyprint-override"><code>private static final OkHttpClient GLOBAL_OK_HTTP_CLIENT = new OkHttpClient.Builder()
      .readTimeout(10, TimeUnit.SECONDS)
      .build();
  </code></pre>
  <p>The error is this:</p>
  <pre class="lang-none prettyprint-override"><code>The type java.time.Duration cannot be resolved. It is indirectly referenced from required .class files
  </code></pre>
  <p>This error is only shown by the editor. Indeed, when I compile my project using CLI (outside Eclipse) I don't get any error for that implicit reference to the <code>java.time</code> package.</p>
  <p>I'm aware that in Java 7 there is no <code>java.time</code> package. Indeed, I'm not using it in my code, it's just implicitly referenced by the OkHttp library (as the error message says).</p>
  <p>Is there a way to fix this error on Eclipse?</p>
  <p>This is how I configured compiler compliance on Eclipse:</p>
  <p><a href="https://i.stack.imgur.com/jsv62.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jsv62.png" alt="Eclipse compiler compliance" /></a></p>
  <p>Note that I can't upgrade to newer Java versions.</p>