Issue using java pitt.search.semanticvectors.BuildIndex on a Mac OSX

175 views
Skip to first unread message

Gabrielle R

unread,
Apr 30, 2013, 2:51:07 AM4/30/13
to semanti...@googlegroups.com
Hey. I was able to get "java org.apache.lucene.demo.IndexFiles" step done just fine as suggested in the installation instructions. However, moving onto the next step, trying to input "java pitt.search.semanticvectors.BuildIndex" into my terminal is not working out for me. I'm getting errors such as:

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(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: pitt.search.semanticvectors.BuildIndex.. Program will exit.

No idea why I'm getting this since I have seem to set everything up as instructed. My folder path is like this: /home/data/SemanticVectors/semanticvectors-3.8 so I am in semantic vectors package folder I am trying to use. Is there something I could possibly be missing?

Thank you for your time.

Dominic Widdows

unread,
Apr 30, 2013, 8:43:12 PM4/30/13
to semanti...@googlegroups.com
Yes - java doesn't be default include your current directory in the classpath.

So even if you've set up a CLASSPATH environment variable with the Lucene dependencies, you still need to have the semantic vectors directory (/home/data/SemanticVectors/semanticvectors-3.8) in your CLASSPATH.

If you try "CLASSPATH="$CLASSPATH;/home/data/SemanticVectors/semanticvectors-3.8" before running the java command, I suspect that this will work.

Or if you haven't set up the Lucene dependencies in the classpath yet, you'll at least move on to the next error message which should tell you to do this. (But if you haven't done this yet, then you probably don't have a Lucene index to point semantic vectors at, so the next message you're likely to see is "-luceneindexpath must be set", since the BuildIndex program checks this flag-configuration before loading any of the Lucene dependencies themselves.)

Best wishes,
Dominic




--
You received this message because you are subscribed to the Google Groups "Semantic Vectors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semanticvecto...@googlegroups.com.
To post to this group, send email to semanti...@googlegroups.com.
Visit this group at http://groups.google.com/group/semanticvectors?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gabrielle R

unread,
May 7, 2013, 1:02:16 AM5/7/13
to semanti...@googlegroups.com
Hello! Thank you for the response. Sadly this has not been working though. After I generate the index folder do I have to be in that as well? The contents inside are currently labeled as:
_1.fdt  _1.fdx  _1.fnm  _1.frq  _1.nrm  _1.prx  _1.tii  _1.tis  segments_2  segments.gen

Not sure if that has anything to do with the issue. And as far as I know semanticvectors-3.8 includes the build index command that I'm attempted to use. Perhaps I need to modify the command line a bit from simply "java pitt.search.semanticvectors.BuildIndex"? Not sure if it would be different because I'm on a  mac OS X though that is a possiblity that just came to mind. Any other ideas or help is very much appreciated. 

Dominic Widdows

unread,
May 7, 2013, 1:11:49 PM5/7/13
to semanti...@googlegroups.com
Hi there,

What error message are you seeing? If it's a "class not found" error then it's still your classpath that's the problem.

If on the other hand it says something like:

$ java pitt.search.semanticvectors.BuildIndex
Exception in thread "main" java.lang.IllegalArgumentException: -luceneindexpath must be set.
        at pitt.search.semanticvectors.BuildIndex.main(BuildIndex.java:81)

then you may be missing a command line flag, -luceneindexpath $PATH_TO_YOUR_LUCENE_INDEX.

Please let me know if it's one of these or something else (and if you, please include a cut'n'paste of your command and error messages).

Best wishes,
Dominic

Gabrielle R

unread,
May 8, 2013, 7:09:56 PM5/8/13
to semanti...@googlegroups.com
The error shows up like this:
user:/home/data/SemanticVectors/semanticvectors-3.8/test$ 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(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: pitt.search.semanticvectors.BuildIndex. Program will exit.

I'm not seeing the error you're saying it might be but I don't remember setting up any classpaths to the index at all. Not sure if that could still be it.
Is there in error in my how I'm going about it some other way perhaps? I noticed that it says in the compiling stage with the ant command it reccommends the compiler be upgraded but it also says that it's done successfully. Is it possible thats it though?



This is how the process has been for me as a whole so far if that helps:
user:~$ cd /home/data/SemanticVectors/semanticvectors-3.8/
user:/home/data/SemanticVectors/semanticvectors-3.8$ ls
AUTHORS  build.xml  doc    lib      src   thirdparty
build    dist       index  LICENSE  test
user:/home/data/SemanticVectors/semanticvectors-3.8$ ant
Buildfile: /home/data/SemanticVectors/semanticvectors-3.8/build.xml

init:

compile-deps:

compile:

doc:
  [javadoc] Generating Javadoc
  [javadoc] Javadoc execution
  [javadoc] Loading source files for package pitt.search.lucene...
  [javadoc] Loading source files for package pitt.search.semanticvectors...
  [javadoc] Loading source files for package pitt.search.semanticvectors.vectors...
  [javadoc] Constructing Javadoc information...
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/hashing/Bobcat.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(ch/akuhn/edu/mit/tedlab/SMat.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/VectorStoreWriterTest.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/VectorStoreWriterTest$1.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/VectorStoreWriter$1.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/VectorStoreUtils$1.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/VectorStoreReaderLuceneTest.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/VectorStoreReaderLuceneTest$2.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/VectorStoreReaderLuceneTest$1.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/VectorStoreReaderLucene$1.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/VectorStoreReader$1.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/VectorStoreRAMTest.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/VectorStoreDeterministicTest.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/TestUtils.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/Search$1.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/LuceneUtils$1.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/FlagConfigTest.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/CompoundVectorBuilderTest.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/BuildPositionalIndex$1.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/BuildIndex$1.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/AllTests.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/vectors/VectorUtilsTest.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/vectors/VectorFactory$1.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/vectors/RealVectorTest.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/vectors/PermutationUtilsTest.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/vectors/ComplexVectorTest.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/vectors/ComplexVector$1.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] warning: /home/data/SemanticVectors/semanticvectors-3.8/lib/semanticvectors-3.8.jar(pitt/search/semanticvectors/vectors/BinaryVectorTest.class): major version 51 is newer than 50, the highest major version supported by this compiler.
  [javadoc] It is recommended that the compiler be upgraded.
  [javadoc] Standard Doclet version 1.6.0_27
  [javadoc] Building tree for all the packages and classes...
  [javadoc] Building index for all the packages and classes...
  [javadoc] Building index for all classes...
  [javadoc] Generating /home/data/SemanticVectors/semanticvectors-3.8/doc/stylesheet.css...
  [javadoc] 28 warnings

jardist:

tardist:
      [tar] Nothing to do: /home/data/SemanticVectors/semanticvectors-3.8/dist/semanticvectors-3.8-src.tar is up to date.
     [gzip] Nothing to do: /home/data/SemanticVectors/semanticvectors-3.8/dist/semanticvectors-3.8-src.tar.gz is up to date.

zipdist:

build-all:

BUILD SUCCESSFUL
Total time: 4 seconds
user:/home/data/SemanticVectors/semanticvectors-3.8$ cd test
user:/home/data/SemanticVectors/semanticvectors-3.8/test$ export CLASSPATH=./lib/lucene-core-3.6.2.jar:./lib/lucene-demo-3.6.2.jar:/home/data/SemanticVectors/semanticvectors-3.8
user:/home/data/SemanticVectors/semanticvectors-3.8/test$ java org.apache.lucene.demo.IndexFiles -docs .
Indexing to directory 'index'...
adding ./175.txt
adding ./index/_1.nrm
adding ./index/_1.tii
adding ./index/_1.fdt
adding ./index/_1.tis
adding ./index/_2.fdx
adding ./index/_1.fnm
adding ./index/_2.fdt
adding ./index/_1.fdx
adding ./index/segments_2
adding ./index/segments.gen
adding ./index/_1.frq
adding ./index/_1.prx
adding ./index/write.lock
adding ./lib/set
adding ./lib/lucene-core-3.6.2.jar
adding ./lib/index/_0.tii
adding ./lib/index/_0.fnm
adding ./lib/index/_0.nrm
adding ./lib/index/_0.frq
adding ./lib/index/segments_1
adding ./lib/index/segments.gen
adding ./lib/index/_0.fdx
adding ./lib/index/_0.fdt
adding ./lib/index/_0.prx
adding ./lib/index/_0.tis
adding ./lib/semanticvectors-3.8.jar
adding ./lib/lucene-demo-3.6.2.jar
1794 total milliseconds
user:/home/data/SemanticVectors/semanticvectors-3.8/test$ 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(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: pitt.search.semanticvectors.BuildIndex. Program will exit.

Dominic Widdows

unread,
May 8, 2013, 7:15:45 PM5/8/13
to semanti...@googlegroups.com
Hi there,

It looks like you still need to add the semanticvectors-3.8.jar file
to your classpath.

What happens when you type "echo $CLASSPATH" - is an appropriate
semanticvectors jarfile included?

Note that it looks like your "java org.apache.lucene.demo.IndexFiles
-docs ." command is indexing lots of binary files including the Lucene
index you made already, so the new index produced by this could well
look a little weird - I'd use BuildIndex on your first index once
you've got it working.

Best wishes,
Dominic

Gabrielle R

unread,
May 8, 2013, 10:18:27 PM5/8/13
to semanti...@googlegroups.com
That seemed to solve that problem. But it created a new one. I think my compiler might be out of date, but I'm not sure. What it's saying looks familliar to the warnings I mentioned the ant command getting in my last post.

Here is what I did. Also put the did the echo command so you can see that since you asked.

user:/home/data/SemanticVectors/semanticvectors-3.8/test$ export CLASSPATH=./lib/lucene-core-3.6.2.jar:./lib/lucene-demo-3.6.2.jar:/home/data/SemanticVectors/semanticvectors-3.8:./lib/semanticvectors-3.8.jar

user:/home/data/SemanticVectors/semanticvectors-3.8/test$ echo $CLASSPATH
./lib/lucene-core-3.6.2.jar:./lib/lucene-demo-3.6.2.jar:/home/data/SemanticVectors/semanticvectors-3.8:./lib/semanticvectors-3.8.jar

user:/home/data/SemanticVectors/semanticvectors-3.8/test$ java pitt.search.semanticvectors.BuildIndex
Exception in thread "main" java.lang.UnsupportedClassVersionError: pitt/search/semanticvectors/BuildIndex : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:212)

    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: pitt.search.semanticvectors.BuildIndex. Program will exit.

If I'm right about the compiler, do you have an idea of how I could go about updating it? Or is there a different problem?

Thank you for the tip on the index thing. I was concerned about that. Is there a way to specify it going to only one file? Been trying to figure out how to control it but my current issue has been distracting me.

Gabrielle R

unread,
May 11, 2013, 3:32:31 AM5/11/13
to semanti...@googlegroups.com
Oh actually I fixed that error. I was right about the compiler needing to be updated.

I have this new one which I think may be even simpler,but I'm not sure exactly how to pinpoint something as luceneindexpath. Do you know? After this it MUST work I think.

Here is the error message:

Exception in thread "main" java.lang.IllegalArgumentException: -luceneindexpath must be set.
    at pitt.search.semanticvectors.BuildIndex.main(BuildIndex.java:81)


Dominic

unread,
May 13, 2013, 12:59:59 PM5/13/13
to semanti...@googlegroups.com
Whatever directory your Lucene index is in, that should be supplied as the -luceneindexpath argument to BuildIndex. That is, something like:

java pitt.search.semanticvectors.BuildIndex -luceneindexpath $YOUR_INDEX_PATH.

Best wishes,
Dominic

Gabrielle R

unread,
May 15, 2013, 1:37:56 AM5/15/13
to semanti...@googlegroups.com
Thank you! That seems to be getting it working. Thank you for all the help. I think I'm starting to get the hang of this now.
Reply all
Reply to author
Forward
0 new messages