In addition: You use cygwin, but the java.exe is a win32 native application expecting win32-conform path names. So if you create the CLASSPATH using cygwin's unix-style path names (with /usr/... and : as separator) they are not parseable by win32 Java. They must be formed using standard drive-letter/backslash/semicolon-separated in the env var!
Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -----Original Message----- > From: Steven A Rowe [mailto:sar...@syr.edu] > Sent: Thursday, November 18, 2010 6:42 PM > To: general@lucene.apache.org > Subject: RE: ClassNotFoundException > > Hi Lewis, > > You should use the java-u...@l.a.o list rather than gene...@l.a.o, which is > not > intended to be used to answer end-user questions. The java-user mailing list > has way more subscribers, so you'll get better/faster responses there, anyway. > > Most likely you don't have the demo jar on the classpath visible to your java > process. > > Are you using the CLASSPATH environment variable? How do you set it? In > Cygwin (assuming Bash shell), you need to "export CLASSPATH" to make it > visible to child processes (children of the Bash shell, e.g. the JRE). > (Cygwin > auto-exports all Windows-defined environment variables, so if you used the > interface at "My Computer|Properties|Advanced System Settings|Environment > Variables" to set them, then exporting them under Cygwin is not necessary.) > > You could also try providing the classpath as a cmdline param to the java > executable, e.g. "-classpath /path/to/lucene-core-3.0.1.jar:/path/to/lucene- > demos-3.0.1.jar". > > Steve > > > -----Original Message----- > > From: McGibbney, Lewis John [mailto:lewis.mcgibb...@gcu.ac.uk] > > Sent: Thursday, November 18, 2010 9:53 AM > > To: general@lucene.apache.org > > Subject: ClassNotFoundException > > > > Hello List, > > > > Currently using lucene-3.0.1 on Windows XP with Cygwin to execute > > commands > > > > Trying to index files in my directory and I am receiving the following > > > > lmcgi...@bne001840 > > /cygdrive/c/Downloads/Apache/lucene-3.0.1/lucene-3.0.1 > > $ java org.apache.lucene.demo.IndexFiles > > C:/Downloads/Apache/lucene-3.0.1/ lucene-3.0.1/src Exception in thread > > "main" java.lang.NoClassDefFoundError: > > org/apache/lucene/dem > > o/IndexFiles > > Caused by: java.lang.ClassNotFoundException: > > org.apache.lucene.demo.IndexFiles > > at java.net.URLClassLoader$1.run(Unknown Source) > > at java.security.AccessController.doPrivileged(Native Method) > > at java.net.URLClassLoader.findClass(Unknown Source) > > at java.lang.ClassLoader.loadClass(Unknown Source) > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) > > at java.lang.ClassLoader.loadClass(Unknown Source) Could not > > find the main class: org.apache.lucene.demo.IndexFiles Program will > > exit. > > > > I have both lucene-core-3.0.1 and lucene-demos-3.0.1 in my classpath, > > although I also have a Nutch/lib variable which includes > > lucene-core-3.0.1 already set in my environment as I have been using this > project as well... > > is this the problem? If not can someone please suggest what is going > > wrong. > > > > Thank you > > > > Lewis > > > > Glasgow Caledonian University is a registered Scottish charity, number > > SC021474 > > > > Winner: Times Higher Education's Widening Participation Initiative of > > the Year 2009 and Herald Society's Education Initiative of the Year > > 2009 > > http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6 > > 219, > > en.html