Fibd my File attached Can you please describe ur error? It will help us in finding the mistake that u may be doing.
compiling and running HelloLucene.java is similar as compiling and running any other java . HelloLucene uses Lucene class files , so it is needed in classpath My compilation and run(using commandline to set the classpath) -> try it *compile-*> $javac -Xlint -cp /home/anurag/lucene-2.9.1/lucene-core-2.9.1.jar HelloLucene.java output: HelloLucene.java:23: warning: [deprecation] StandardAnalyzer() in org.apache.lucene.analysis.standard.StandardAnalyzer has been deprecated IndexWriter w = new IndexWriter(index, new StandardAnalyzer(), true, new MaxFieldLength(250)); ^ HelloLucene.java:33: warning: [deprecation] StandardAnalyzer() in org.apache.lucene.analysis.standard.StandardAnalyzer has been deprecated Query q = new QueryParser("title", new StandardAnalyzer()).parse(querystr); ^ HelloLucene.java:33: warning: [deprecation] QueryParser(java.lang.String,org.apache.lucene.analysis.Analyzer) in org.apache.lucene.queryParser.QueryParser has been deprecated Query q = new QueryParser("title", new StandardAnalyzer()).parse(querystr); ^ HelloLucene.java:36: warning: [deprecation] IndexSearcher(org.apache.lucene.store.Directory) in org.apache.lucene.search.IndexSearcher has been deprecated IndexSearcher s = new IndexSearcher(index); *run->* $java HelloLucene output: Found 2 hits. 1. Document<stored/uncompressed,indexed,tokenized<title:Lucene in Action>> 2. Document<stored/uncompressed,indexed,tokenized<title:Lucene for Dummies>> Note: I am attaching my HelloLucene.java( try it) On Wed, May 18, 2011 at 8:26 PM, ravishekhar [via Lucene] < ml-node+2957248-2072374620-146...@n3.nabble.com> wrote: > Hi, > > Ya I am using Ubuntu. > I think ClassPath is set properly else how I am able to run Demo code > with Lucene. > Also I am able to run my written code through Netbeans too. > > Can you please tell me I have that " HelloLucene.java " program. > How to compile and run it. > > Thanks, > Ravi. > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://lucene.472066.n3.nabble.com/Writing-new-peice-of-code-in-Lucene-tp2956161p2957248.html > To start a new topic under Lucene - General, email > ml-node+642108-1580214077-146...@n3.nabble.com > To unsubscribe from Lucene - General, click > here<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=642108&code=YW51cmFnLml0LmpvbGx5QGdtYWlsLmNvbXw2NDIxMDh8LTIwOTgzNDQxOTY=>. > > -- Kumar Anurag ----- Kumar Anurag -- View this message in context: http://lucene.472066.n3.nabble.com/Writing-new-peice-of-code-in-Lucene-tp2956161p2958035.html Sent from the Lucene - General mailing list archive at Nabble.com.