我想尝试 JogAmp JOGL 构建,所以我在 Maven Central 上找到了这个 Artifact :
http://search.maven.org/#search|ga|1|a%3A%22jogl-all%22
也就是说,有一个主要的 jar
和一些特定于架构的 jar:natives-android-aarch64.jar
、natives-android-armv6 .jar
、natives-linux-amd64.jar
、natives-linux-armv6.jar
、natives-linux-armv6hf.jar
> 等
现在我想在 Scala 中构建一个应用程序,我可以在我的 Linux 桌面上测试它 - 我猜架构将是 natives-linux-amd64.jar
-,然后部署在 Raspberry Pi 上3B 与 Raspbian Jessie - 架构可能是 natives-linux-armv6.jar
(或 natives-linux-armv6hf.jar
?)。
如何告诉 sbt 在每个平台上下载正确的库?
libraryDependencies += "org.jogamp.jogl" % "jogl-all" % "2.3.2"
还有什么?
编辑: 就像现在我找到了 MovieCube
源代码,但尝试使用任何类型的开关(-es2
、 >-es3
、-gldef
、-gl3
)只是给了我以下内容:
url_s null
file_s /home/foo/Documents/foo.mp4
stream file:/home/foo/Documents/foo.mp4
vid -1, aid -1
textureCount 4
forceES2 true
forceES3 false
forceGL3 false
forceGLDef false
swapInterval 1
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.jogamp.opengl.GLProfile
at com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube.main(MovieCube.java:555)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
...我猜我在哪里缺少一些 native 库?
最佳答案
您需要通过指定正确的分类器将架构特定的 jar 添加为依赖项。
libraryDependencies ++= {
val architecture = Seq(
"natives-linux-amd64",
"natives-linux-armv6"
)
"org.jogamp.jogl" % "jogl-all" % "2.3.2" +: architecture.map(
"org.jogamp.jogl" % "jogl-all" % "2.3.2" classifier _
)
}
关于scala - JogAmp/JOGL - sbt 如何选择正确的 native jar?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39194625/