title: Ant: error: cannot find symbol: symbol: class Server: location: class SslContextFactory. Even though the JAR is in the classpath
body: <p>I'm building this project (with modifications): <a href="https://github.com/nextgenhealthcare/connect" rel="nofollow noreferrer">https://github.com/nextgenhealthcare/connect</a></p>
  
  <p>I have the following code:</p>
  
  <pre><code>import org.eclipse.jetty.util.ssl.SslContextFactory;
  public class HttpsReceiver extends SourceConnector implements BinaryContentTypeResolver {
      @Override
      public void onStart() throws ConnectorTaskException {
  ...
              SslContextFactory sslContextFactory = new SslContextFactory.Server();
  </code></pre>
  
  <p>When I build with the included Ant script, I get an error:</p>
  
  <pre><code>C:\Users\Chloe\workspace\spinsci\connect-3.8.1\server&gt;ant compile -debug
  ...
  compile:
      [mkdir] Created dir: C:\Users\Chloe\workspace\spinsci\connect-3.8.1\server\classes
  ...
      [javac] Compiling 822 source files to C:\Users\Chloe\workspace\spinsci\connect-3.8.1\server\classes
      [javac] Using modern compiler
      [javac] Compilation arguments:
      [javac] '-d'
      [javac] 'C:\Users\Chloe\workspace\spinsci\connect-3.8.1\server\classes'
      [javac] '-classpath'
  ...
  ...;C:\Users\Chloe\workspace\spinsci\connect-3.8.1\server\lib\jetty\jetty-util-9.4.24.v20191120.jar;...
  ...
      [javac] C:\Users\Chloe\workspace\spinsci\connect-3.8.1\server\src\com\mirth\connect\connectors\https\HttpsReceiver.java:311: error: cannot find symbol
      [javac]             SslContextFactory sslContextFactory = new SslContextFactory.Server();
      [javac]                                                                        ^
      [javac]   symbol:   class Server
      [javac]   location: class SslContextFactory
  </code></pre>
  
  <p>However, that class and JAR does exist!</p>
  
  <pre><code>C:\Users\Chloe\workspace\spinsci\connect-3.8.1\server&gt;jar -tf C:\Users\Chloe\workspace\spinsci\connect-3.8.1\server\lib\jetty\jetty-util-9.4.24.v20191120.jar | grep Server
  org/eclipse/jetty/util/ssl/SslContextFactory$Server.class
  </code></pre>
  
  <p>So why is Ant complaining that it can't find the class when it is available? </p>
  
  <p>Here is the <code>build.xml</code>:</p>
  
  <pre><code>&lt;target name="init"&gt;
      &lt;path id="classpath"&gt;
          &lt;fileset dir="${lib}" includes="**/*.jar" /&gt;
      &lt;/path&gt;
  ...
  &lt;target name="compile" depends="clean, init, create-javadocs"&gt;
      &lt;!-- compile the source --&gt;
      &lt;mkdir dir="${classes}" /&gt;
  
      &lt;javac srcdir="${src}" destdir="${classes}" debug="on" includeAntRuntime="false"&gt;
          &lt;classpath refid="classpath" /&gt;
      &lt;/javac&gt;
  </code></pre>
  
  <p>I tried adding the line</p>
  
  <pre><code>import org.eclipse.jetty.util.ssl.SslContextFactory.Server;
  </code></pre>
  
  <p>But then Eclipse complained with an error <code>The import org.eclipse.jetty.util.ssl.SslContextFactory.Server collides with another import statement</code>.</p>