title: Apache Spark Mlib
body: <p>I'm trying to use the MLlib from Spark to implement KMeans on Java and I've stumbled upon a problem, which is that, despite the fact that I've imported the correct jar's my compiler will not recognise this line</p>
  
  <pre><code>// Cluster the data into two classes using KMeans
      int numClusters = 2;
      int numIterations = 20;
      KMeansModel clusters = KMeans.train(parsedData.rdd(), numClusters, numIterations);
  </code></pre>
  
  <p>The error I get is: <code>The method train(&lt;RDD&gt; vector, int, int) is undefined for the type KMeans()</code>
  Which doesn't make any sense since, I've downloaded the latest apache MLlib(1.5.2) jar and also it is defined in the Javadoc.</p>
  
  <p>Any ideas? Has anyone encountered this sort of problem before?</p>