gephi / gephi-toolkit-demos

Quick demos using the Toolkit
95 stars 88 forks source link

Demo doesn't work #6

Closed Bios-Marcel closed 5 months ago

Bios-Marcel commented 7 years ago

The demo won't even start.

I am getting those errors when trying to run PreviewJFrame.java:

Exception in thread "main" java.lang.NoClassDefFoundError: it/unimi/dsi/fastutil/objects/Object2IntMap
    at org.gephi.io.importer.impl.ImportContainerFactoryImpl.newContainer(ImportContainerFactoryImpl.java:52)
    at org.gephi.io.importer.impl.ImportControllerImpl.importFile(ImportControllerImpl.java:174)
    at org.gephi.io.importer.impl.ImportControllerImpl.importFile(ImportControllerImpl.java:228)
    at org.gephi.io.importer.impl.ImportControllerImpl.importFile(ImportControllerImpl.java:146)
    at org.gephi.toolkit.demos.PreviewJFrame.script(PreviewJFrame.java:56)
    at org.gephi.toolkit.demos.PreviewJFrame.main(PreviewJFrame.java:100)
Caused by: java.lang.ClassNotFoundException: it.unimi.dsi.fastutil.objects.Object2IntMap
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 6 more

I am assuming this is somewhat related to the problem stated in #3 , despite the fact that the last commitmessages claim to have updated everything?

tkobaya commented 5 years ago

Hi,

I faced the same problem and fixed it. You just need to add a declaration of a dependency to FastUtil in pom.xml like:

    <dependencies>
        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>gephi-toolkit</artifactId>
            <version>${project.version}</version>
        </dependency>
+        <dependency>
+            <groupId>it.unimi.dsi</groupId>
+            <artifactId>fastutil</artifactId>
+            <version>7.0.13</version>
+        </dependency>
    </dependencies>

I tried recent version of FastUtil (8.3.0) but it didn't work. Version 7.0.13 works in my environment (Oracle JDK 8)

daydin commented 5 months ago

The demo doesn't work for me either, but I'm having issues in a different way. I'm getting a java.lang.ClassNotFoundException: org.gephi.toolkit.demos.Main even though I have the whole toolkit locally cloned. I'm trying to run Main.java with mvn exec:java -Dexec.mainClass=org.gephi.toolkit.demos.Main.

seinecle commented 5 months ago

You neee to build the project before running it.

daydin commented 5 months ago

D'oh, thanks!