Compile time warning and runtime error in jcuda sample program

I am trying to run the sample program of java given at jcuda.org - Tutorial , using CUDA 7.5 and corresponding jar of jcuda 0.7.5b. I am done with the gpu and the CUDA Toolkit and its working fine with visual c++ but when i move to java to run a sample program its giving me the error. I am working with windows 10. At the time of compilation this shows warning

warning: jcuda\pointer.class(jcuda:pointer.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
warning: jcuda\NativepointerObject.class(jcuda:NativePointerObject.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
warning: jcuda\runtime\jcuda.class(jcuda\runtime:jcuda.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.

At runtime it is giving error

Error: could not find or load main class JCudaRuntimeTest

not able to find the solution. plz guide me.

This refers to the version number of the .class files. It roughly means that the classes in the JCuda JARs have been compiled with a Java version that is newer than yours.

Which version of the Java JDK do you have installed?
(And maybe: Which IDE? Eclipse?)

i am working with jdk 1.7. when i try to work with netbeans 7.2 and this gives me error

Error while loading native library “JCudaDriver-windows-x86_64” with base name “JCudaDriver”
Operating system name: Windows 10
Architecture : amd64
Architecture bit size: 64
Stack trace from the attempt to load the library as a resource:
java.lang.NullPointerException: No resource found with name ‘/lib/JCudaDriver-windows-x86_64.dll’…
and so on which is almost same as ImageJ - Help setting up JCuda / ImageJ / Netbeans

So you now can compile and start the JCudaRuntimeTest, but then it causes an UnsatisfiedLinkError?

Note that this error is very common (also see the FAQ).

However, it would be helpful if you provided the full stack trace. It should also contain information about an attempt to load the library as a file, and this is the relevant part here.

when i am working with notepad and jdk 1.7 or jdk 1.8 it gives error which i mentioned earlier and it is

warning: jcuda\pointer.class(jcudaointer.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
warning: jcuda\NativepointerObject.class(jcuda:NativePointerObject.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
warning: jcuda\runtime\jcuda.class(jcuda\runtime:jcuda.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.

At runtime it is giving error

Error: could not find or load main class JCudaRuntimeTest

while working with netbeans IDE 7.2 and jdk 1.7 it gives error and the full stack trace is here:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load the native library.
Error while loading native library "JCudaRuntime-windows-x86_64" with base name "JCudaRuntime"
Operating system name: Windows 8.1
Architecture         : amd64
Architecture bit size: 64
Stack trace from the attempt to load the library as a resource:
java.lang.NullPointerException: No resource found with name '/lib/JCudaRuntime-windows-x86_64.dll'
	at jcuda.LibUtils.loadLibraryResource(LibUtils.java:149)
	at jcuda.LibUtils.loadLibrary(LibUtils.java:83)
	at jcuda.runtime.JCuda.initialize(JCuda.java:383)
	at jcuda.runtime.JCuda.<clinit>(JCuda.java:370)
	at jcudaruntimetest.JCudaRuntimeTest.main(JCudaRuntimeTest.java:14)
Stack trace from the attempt to load the library as a file:
java.lang.UnsatisfiedLinkError: no JCudaRuntime-windows-x86_64 in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
	at java.lang.Runtime.loadLibrary0(Runtime.java:849)
	at java.lang.System.loadLibrary(System.java:1088)
	at jcuda.LibUtils.loadLibrary(LibUtils.java:94)
	at jcuda.runtime.JCuda.initialize(JCuda.java:383)
	at jcuda.runtime.JCuda.<clinit>(JCuda.java:370)
	at jcudaruntimetest.JCudaRuntimeTest.main(JCudaRuntimeTest.java:14)

	at jcuda.LibUtils.loadLibrary(LibUtils.java:128)
	at jcuda.runtime.JCuda.initialize(JCuda.java:383)
	at jcuda.runtime.JCuda.<clinit>(JCuda.java:370)
	at jcudaruntimetest.JCudaRuntimeTest.main(JCudaRuntimeTest.java:14)
Java Result: 1

it works for me when i studied https://forum.byte-welt.net/byte-welt-projekte-projects/jcuda/2972-jcuda-faq-please-read-posting.html

thank you so much for your guidance :slight_smile: