Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoClassDefFoundError: gnu/trove/map/TObjectIntMap #49

Open
jiangfeng1124 opened this issue Apr 2, 2014 · 3 comments
Open

NoClassDefFoundError: gnu/trove/map/TObjectIntMap #49

jiangfeng1124 opened this issue Apr 2, 2014 · 3 comments

Comments

@jiangfeng1124
Copy link

Dear developers,

I passed the "mvn compile" and "mvn test" step. But I met the following problems while running:

java -cp target/classes edu.ucla.sspace.mains.VsmMain -d data/test.txt data/ -o text

java.lang.NoClassDefFoundError: gnu/trove/map/TObjectIntMap
    at edu.ucla.sspace.common.GenericTermDocumentVectorSpace.processDocument(GenericTermDocumentVectorSpace.java:199)
    at edu.ucla.sspace.mains.GenericMain$1.run(GenericMain.java:586)
    at edu.ucla.sspace.util.WorkQueue$CountingRunnable.run(WorkQueue.java:361)
    at edu.ucla.sspace.util.WorkerThread.run(WorkerThread.java:110)
Caused by: java.lang.ClassNotFoundException: gnu.trove.map.TObjectIntMap
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    ... 4 more

How could I solve it?

@davidjurgens
Copy link
Collaborator

Hi Jiang,

Your Java classpath does not include the GNU Trove library, so the
exception is expect. You need to either (1) download the GNU Trove library
and include in your classpath, or (2) run "mvn package," which will wrap
all of the dependencies in the jar file at
target/sspace-2.0.4-jar-with-dependencies.jar
, which you can then include in your classpath.

Thanks,
David

On Tue, Apr 1, 2014 at 8:47 PM, jiangfeng [email protected] wrote:

Dear developers,

I passed the "mvn compile" and "mvn test" step. But I met the following
problems while running:

java -cp target/classes edu.ucla.sspace.mains.VsmMain -d data/test.txt
data/ -o text

java.lang.NoClassDefFoundError: gnu/trove/map/TObjectIntMap
at edu.ucla.sspace.common.GenericTermDocumentVectorSpace.processDocument(GenericTermDocumentVectorSpace.java:199)
at edu.ucla.sspace.mains.GenericMain$1.run(GenericMain.java:586)
at edu.ucla.sspace.util.WorkQueue$CountingRunnable.run(WorkQueue.java:361)
at edu.ucla.sspace.util.WorkerThread.run(WorkerThread.java:110)
Caused by: java.lang.ClassNotFoundException: gnu.trove.map.TObjectIntMap
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 4 more

How could I solve it?

Reply to this email directly or view it on GitHubhttps://github.com//issues/49
.

@jiangfeng1124
Copy link
Author

Thanks a lot David! Not so familiar with maven :-)

@macheeto
Copy link

In my case (OSX) running "mvn package" builds sspace-2.0.4.jar without any dependencies. Running "mvn assembly:single" builds sspace-2.0.4-jar-with-dependencies.jar which contains gnu.trove classes but not sspace classes.

sspace-2.0.4.jar contains these packages:

  • edu/ucla/sspace
  • jnt/FFT
  • org/tartarus/snowball

sspace-2.0.4-jar-with-dependencies.jar contains only one package:

  • gnu/trove

Also for those who have build issues related to SVD library:

  1. create new temp folder, inside run this:
  2. git clone https://github.com/lucasmaystre/svdlibc.git
  3. cd svdlibc
  4. make
  5. sudo make install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants