Java似乎找不到我的本机库 [英] Java can't seem to find my native libraries

查看:60
本文介绍了Java似乎找不到我的本机库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从名为PViz.jar的jar运行程序.该jar文件位于其所有相关jar文件及其所依赖的.so文件的目录中.我使用的是Mac OSX.运行此程序时:

I am trying to run my program from my jar, called PViz.jar. The jar is sitting in a directory with all of its dependent jars and the .so files that they depend on. I am using Mac OS X. When I run this:

java -cp PViz.jar pviz.PVizStart

然后我收到一个UnsatisfiedLinkError,说"java.library.path中没有慢跑".这是合理的,我使用的是jogl.jar,它利用了本地库libjogl.so.

Then I get an UnsatisfiedLinkError saying "no jogl in java.library.path". This is reasonable, i'm using jogl.jar which makes use of the native library libjogl.so.

所以我运行这个:

java -Djava.library.path=. -cp PViz.jar pviz.PVizStart

,我得到同样的错误.但是libjogl.so在当前目录中!我想也许我需要给出整个路径,所以我尝试了以下方法:

and I get the same error. But libjogl.so is in the current directory! I figured maybe I needed to give the whole path, so I tried this:

java -Djava.library.path=/bla/bla/bla/libjogl.so -cp PViz.jar pviz.PVizStart

,它仍然给我相同的UnsatisifedLinkError.啊!

and it still gives me the same UnsatisifedLinkError. Argh!

推荐答案

Here is a step by step explanation on how to setup jogl on different operating systems, OS X included.

这篇关于Java似乎找不到我的本机库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆