title: MongoDB and java - cannot find Document class
body: <p>I am trying to connect Java and MongoDB. I wrote the following code:</p>
  
  <pre><code>MongoClient mongoClient = new MongoClient("localhost", 27017);
  MongoDatabase database = mongoClient.getDatabase("testDB");
  database.getCollection(database.getCollection("testC"));
  </code></pre>
  
  <p>So I have this error <code>The method getCollection(String) from the type MongoDatabase refers to the missing type Document</code>. Has anybody some idea how to fix that? I use 3.2 drivers.
  Thanks in advance.
  P.S. Actually when I add it via dependency in maven project it working, but when I add driver via jar it is not. How can I make it work via manually adding a jar.</p>