I’m a new JCuda user and I started to try some samples in my node.
I’m running a simple:
import jcuda.*;
import jcuda.runtime.*;
public class JCudaRuntimeTest{
public static void main(String args[]){
Pointer pointer = new Pointer();
JCuda.cudaMalloc(pointer, 4);
System.out.println("Pointer: "+pointer);
JCuda.cudaFree(pointer);
}
}
I put every library in the same folder and a can easily compile the code, but when I run java JCudaRuntimeTest, I got this exception.
Exception in thread "main" java.lang.NoClassDefFoundError: jcuda/Pointer
at JCudaRuntimeTest.main(JCudaRuntimeTest.java:7)
Caused by: java.lang.ClassNotFoundException: jcuda.Pointer
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 1 more
suggestions?
NoClassDefFoundErroralmost always means that something is missing from your classpath.Make sure the
jcuda-<version>.jarfile (as well as possibly other necessary JAR files) are on the classpath when you run your program.You can specify the classpath when you run your program with the
-cpswitch, for example:or by setting the
CLASSPATHenvironment variable (not recommended).