Exception in thread "main" java.lang.NoClassDefFoundError: -cp
Caused by: java.lang.ClassNotFoundException: -cp
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: -cp. Program will exit.
Perhaps due to some system settings i am playing with last couple of days to make my app working.
On Tuesday, April 23, 2013 1:58:56 PM UTC+5:30, Piyush Arya wrote:
I am using Javacpp with maven 2.1 on Ubuntu 11.10.
pom.xml include exec plugin as shown
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>javacpp</id>
<phase>process-classes</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument> -jar </argument> <argument> /home/piyush/JCuda/javacpp.jar </argument>
<argument> -classpath </argument> <argument> ${project.build.outputDirectory}:/home/piyush/JCuda/jcuda-0.5.0.jar:/home/piyush/JCuda/jcusparse-0.5.0.jar </argument>
<argument> -d </argument> <argument> ${project.build.outputDirectory}/lib/ </argument>
<argument> -properties </argument> <argument> linux-x86_64-cuda </argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
When nvcc is compiling jniOps.cu file it is showing error-
/home/piyush/TestWebapp6/target/classes/lib/jniCudaOps.cu(1154): error: a namespace name is not allowed
which in code is
JNIEXPORT void JNICALL Java_com_skenzo_cuda_CudaOps_copy(JNIEnv* env, jclass cls, jobject arg0, jobject arg1, jobject arg2) {
thrust* ptr0 = arg0;
thrust* ptr1 = arg1;
int* ptr2 = arg2 == NULL ? NULL : (int*)jlong_to_ptr(env->GetLongField(arg2, JavaCPP_addressFID));
jint position2 = arg2 == NULL ? 0 : env->GetIntField(arg2, JavaCPP_positionFID);
ptr2 += position2;
try {
thrust::copy(*ptr0, *ptr1, ptr2);
} catch (...) {
JavaCPP_handleException(env);
}
}