Login  Register

ZipException / classpath problem with jocl trying to run HelloJOCL

Posted by nyholku on Nov 20, 2013; 8:10am
URL: https://forum.jogamp.org/ZipException-classpath-problem-with-jocl-trying-to-run-HelloJOCL-tp4030658.html

I'm trying to run this code in Eclipse:

http://jogamp.org/wiki/index.php/JOCL_Tutorial

I've set up my class path like this:

http://www.sparetimelabs.com/temp/jocl-classpath.png

when I run the code I get:

Catched ZipException: error in opening zip file, while addNativeJarLibsImpl(classFromJavaJar class com.jogamp.common.os.Platform, classJarURI jar:file:/Users/nyholku/JoclTests/jogamp-all-platforms-v2.1.1/jar/gluegen.jar!/com/jogamp/common/os/Platform.class, nativeJarBaseName gluegen-natives-macosx-universal.jar): [ file:/Users/nyholku/JoclTests/jogamp-all-platforms-v2.1.1/jar/gluegen.jar -> file:/Users/nyholku/JoclTests/jogamp-all-platforms-v2.1.1/jar/ ] + gluegen-natives-macosx-universal.jar -> slim: jar:file:/Users/nyholku/JoclTests/jogamp-all-platforms-v2.1.1/jar/gluegen-natives-macosx-universal.jar!/
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.jogamp.common.os.Platform
        at com.jogamp.common.util.VersionUtil.getPlatformInfo(VersionUtil.java:55)
        at com.jogamp.opencl.util.JOCLVersion.getAllVersions(JOCLVersion.java:78)
        at com.jogamp.opencl.CLPlatform.initialize(CLPlatform.java:171)
        at com.jogamp.opencl.CLPlatform.initialize(CLPlatform.java:142)
        at com.jogamp.opencl.CLPlatform.getDefault(CLPlatform.java:184)
        at com.jogamp.opencl.CLContext.create(CLContext.java:171)
        at com.jogamp.opencl.CLContext.create(CLContext.java:146)
        at HelloJOCL.main(HelloJOCL.java:28)

and I can't figure out what I'm doing wrong.

An almost identical project/build path setup in Eclipse works for me with jogl.

br Kusti





java -jar jocl.jar:gluegen-rt.jar -Djava.library.path="path/to/jocl/libs:path/to/gluegen-rt/libs" com.jogamp.opencl.util.CLInfo