title: The type org.codehaus.jackson.JsonGenerationException cannot be resolved. It is indirectly referenced from required .class files
body: <p>Using this code : </p>
  
  <pre><code>import org.codehaus.jackson.map.ObjectMapper;
  ObjectMapper objectMapper = new ObjectMapper();
  String str = objectMapper.writeValueAsString(myObject);
  </code></pre>
  
  <p>I receive this Eclipse error: </p>
  
  <pre><code>The type org.codehaus.jackson.JsonGenerationException cannot be resolved. It is indirectly referenced from 
   required .class files
  </code></pre>
  
  <p>at line <code>String str = objectMapper.writeValueAsString(myObject);</code></p>
  
  <p>There are three 'JsonGenerationException' class types on my class path (you may have to save the image and open it separately to read the text in the image): </p>
  
  <p><img src="https://i.stack.imgur.com/6Hl9q.png" alt="enter image description here"></p>
  
  <p>Is the reason I'm receiving this error message because JsonGenerationException is in two different jar files and Eclipse is unsure which on to use ? If so how can I fix it ?</p>
  
  <p>I required this jar file : <a href="http://grepcode.com/snapshot/repo1.maven.org/maven2/org.codehaus.jackson/jackson-core-asl/1.9.4" rel="noreferrer">http://grepcode.com/snapshot/repo1.maven.org/maven2/org.codehaus.jackson/jackson-core-asl/1.9.4</a></p>