Search code examples
javaeclipsesolrsolrj

Running SolrJ on Eclipse


I'm trying to setup a SolrJ using Eclipse by following the example in http://lucidworks.com/blog/indexing-with-solrj/

However, when I try to run the code using Run As -> Java Application, it came back with an error saying that 'Selection does not contain a main type'. But I see that that there's a main method in the code, and it has already been added to my code in Eclipse. My eclipse has got the same code as the example, except for the path name and document name.

Is there any thing required that I missed out in order for the code to run successfully in Eclipse?


Solution

  • Ok so that means in alternative:

    A) your're doing "run as -->> Java application" from the wrong class. Open then class that contains the main, right click on that and choos "Runs as Java Application"

    B) your main method has a wrong signature (and therefore is not a valid main method)

      -