简体   繁体   中英

How to get the buildindex step working in the semanticvectors java package on a mac OS X terminal?

I'm trying to use semantic vectors. Here are some links: https://code.google.com/p/semanticvectors/wiki/InstallationInstructions https://code.google.com/p/semanticvectors/

Anyway, I'm on the step where you input java pitt.search.semanticvectors.BuildIndex , but I'm lacking results.

The current part I'm following is "To Build and Search a Model". I am able to compile the package successfully with the ant command and I did get the first step working with first setting the class path with:

export CLASSPATH=./lib/lucene-core-3.6.2.jar:./…

And then inputing

java org.apache.lucene.demo.IndexFiles -docs .

However with this next step I'm getting these errors:

user:/home/data/SemanticVectors/semant… java pitt.search.semanticvectors.BuildIndex
Exception in thread "main" java.lang.NoClassDefFoundError: pitt/search/semanticvectors/BuildIndex
Caused by: java.lang.ClassNotFoundException: pitt.search.semanticvectors.BuildIndex
 at java.net.URLClassLoader$1.run(URLClassLo…
at java.security.AccessController.doPrivile… Method)
at java.net.URLClassLoader.findClass(URLCla…
at java.lang.ClassLoader.loadClass(ClassLoa…
at sun.misc.Launcher$AppClassLoader.loadCla…
at java.lang.ClassLoader.loadClass(ClassLoa…
Could not find the main class: pitt.search.semanticvectors.BuildIndex. Program will exit.

I am using a terminal on a mac OS X

As I see your post, it appears you are not providing a path to the semanticvectors-xxjar file as indicated in

export CLASSPATH=./lib/lucene-core-3.6.2.jar:./…

Once this change is done, it should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM