title: StanfordCoreNLP error in netbeans: Unrecoverable error while loading a tagger model
body: <p>I'm trying to use StanfordCoreNLP to distinguish singular and plural nouns in a sentence.
  As a start, 
  I'm using the code in <a href="http://nlp.stanford.edu/software/corenlp.shtml" rel="nofollow noreferrer">http://nlp.stanford.edu/software/corenlp.shtml</a>.
  In netbeans 8.0 I opend a new java project. I've downloaded <code>stanford-corenlp-full-2014-06-16</code> and added the jar files(which includes the models jar) into my project:</p>
  
  <p><img src="https://i.stack.imgur.com/sP2No.png" alt="enter image description here"></p>
  
  <p>The code- class SingularORPlural:</p>
  
  <pre><code>    import java.util.LinkedList;
  import java.util.List;
  import java.util.Properties;
  
  import edu.stanford.nlp.ling.CoreAnnotations.LemmaAnnotation;
  import edu.stanford.nlp.ling.CoreAnnotations.SentencesAnnotation;
  import edu.stanford.nlp.ling.CoreAnnotations.TokensAnnotation;
  import edu.stanford.nlp.ling.CoreLabel;
  import edu.stanford.nlp.pipeline.Annotation;
  import edu.stanford.nlp.pipeline.StanfordCoreNLP;
  import edu.stanford.nlp.util.CoreMap;
  
  
  /**
   *
   * @author ha
   */
  public class SingularORPlural {
  
      protected StanfordCoreNLP pipeline;
  
      public SingularORPlural() {
          // Create StanfordCoreNLP object properties, with POS tagging
          // (required for lemmatization), and lemmatization
          Properties props;
          props = new Properties();
          props.put("annotators", "tokenize, ssplit, pos, lemma");
  
          /*
           * This is a pipeline that takes in a string and returns various analyzed linguistic forms. 
           * The String is tokenized via a tokenizer (such as PTBTokenizerAnnotator), 
           * and then other sequence model style annotation can be used to add things like lemmas, 
           * POS tags, and named entities. These are returned as a list of CoreLabels. 
           * Other analysis components build and store parse trees, dependency graphs, etc. 
           * 
           * This class is designed to apply multiple Annotators to an Annotation. 
           * The idea is that you first build up the pipeline by adding Annotators, 
           * and then you take the objects you wish to annotate and pass them in and 
           * get in return a fully annotated object.
           * 
           *  StanfordCoreNLP loads a lot of models, so you probably
           *  only want to do this once per execution
           */
          this.pipeline = new StanfordCoreNLP(props);
      }
  
      public List&lt;String&gt; lemmatize(String documentText)
      {
          List&lt;String&gt; lemmas = new LinkedList&lt;String&gt;();
          // Create an empty Annotation just with the given text
          Annotation document = new Annotation(documentText);
          // run all Annotators on this text
          this.pipeline.annotate(document);
          // Iterate over all of the sentences found
          List&lt;CoreMap&gt; sentences = document.get(SentencesAnnotation.class);
          for(CoreMap sentence: sentences) {
              // Iterate over all tokens in a sentence
              for (CoreLabel token: sentence.get(TokensAnnotation.class)) {
                  // Retrieve and add the lemma for each word into the
                  // list of lemmas
                  lemmas.add(token.get(LemmaAnnotation.class));
              }
          }
          return lemmas;
      }
  
  
  }
  </code></pre>
  
  <p>Then in main:</p>
  
  <pre><code>System.out.println("Starting Stanford Lemmatizer");
          String text = "How could you be seeing into my eyes like open doors? \n";
          SingularORPlural slem = new SingularORPlural();
          System.out.println( slem.lemmatize(text) );
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <pre><code>    run:
  Starting Stanford Lemmatizer
  Adding annotator tokenize
  Adding annotator ssplit
  
  Adding annotator pos
  Reading POS tagger model from edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger ... Exception in thread "main" java.lang.RuntimeException: edu.stanford.nlp.io.RuntimeIOException: Unrecoverable error while loading a tagger model
      at edu.stanford.nlp.pipeline.StanfordCoreNLP$4.create(StanfordCoreNLP.java:558)
      at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:85)
      at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:267)
      at edu.stanford.nlp.pipeline.StanfordCoreNLP.&lt;init&gt;(StanfordCoreNLP.java:129)
      at edu.stanford.nlp.pipeline.StanfordCoreNLP.&lt;init&gt;(StanfordCoreNLP.java:125)
      at stanfordposcode.SingularORPlural.&lt;init&gt;(SingularORPlural.java:51)
      at stanfordposcode.StanfordPOSCode.main(StanfordPOSCode.java:74)
  Caused by: edu.stanford.nlp.io.RuntimeIOException: Unrecoverable error while loading a tagger model
      at edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:857)
      at edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:755)
      at edu.stanford.nlp.tagger.maxent.MaxentTagger.&lt;init&gt;(MaxentTagger.java:289)
      at edu.stanford.nlp.tagger.maxent.MaxentTagger.&lt;init&gt;(MaxentTagger.java:253)
      at edu.stanford.nlp.pipeline.POSTaggerAnnotator.loadModel(POSTaggerAnnotator.java:97)
      at edu.stanford.nlp.pipeline.POSTaggerAnnotator.&lt;init&gt;(POSTaggerAnnotator.java:77)
      at edu.stanford.nlp.pipeline.StanfordCoreNLP$4.create(StanfordCoreNLP.java:556)
      ... 6 more
  Caused by: java.io.InvalidClassException: edu.stanford.nlp.tagger.maxent.ExtractorDistsim; local class incompatible: stream classdesc serialVersionUID = 2, local class serialVersionUID = 1
      at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:621)   at java.io.ObjectStreamClass.initNonProxy(  at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:621)
  ObjectStreamClass.java:621)
  ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1623)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
      at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1707)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1345)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
      at edu.stanford.nlp.tagger.maxent.MaxentTagger.readExtractors(MaxentTagger.java:582)
      at edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:808)
      ... 12 more
  Java Result: 1
  BUILD SUCCESSFUL (total time: 3 seconds)
  </code></pre>
  
  <p>How can I solve this error.</p>