2

On OS X 10.8.2, I'm using JNA and gstreamer-java (through the Eclipse IDE) to load gstreamer libraries. At first I installed gstreamer using the SDK provided by gstreamer.com. However, I uninstalled this and use Macports to install it.

The SDK's libs were installed to: /System/Library/Frameworks/GStreamer.framework/Versions/0.10-x64/lib

But that directory no longer exists.

Where Macports installed the libs to:

/opt/local/lib

Now, say I want to set java to know of this location via some environment variable. Is this possible? It seems so, because running this line:

System.out.println( System.getProperty("jna.library.path"));

Shows /System/Library/Frameworks/GStreamer.framework/Versions/0.10-x64/lib. But I cannot for the life of me figure out where that got set. It's not set as a runtime VM argument. My $PATH and $DYLD_LIBRARY_PATH, $LD_LIBRARY_PATH do not have this directory set. They actually have the path I want, /opt/local/lib/ set which has no effect it seems. Running env shows no variables with the Framework path either.

So, jna.library.path. Is it set externally? How can I change it--without setting it at runtime or via java command-line arguments? Zero points for telling me to symlink.

EDIT:

Searching through gstreamer-java's files led me to gstreamer-java.spec, which has this line:

sed -i [...] -e "s,\(run.jvmargs=-Djna.library.path=\).*,\1%{_libdir}:$(pkg-config --variable=pluginsdir gstreamer-0.10),"

Running the contained command pkg-config --variable=pluginsdir gstreamer-0.10 gets me this:

/opt/local/lib/gstreamer-0.10

Which is the correct path for plugins. Further running pkg-config --print-variables gstreamer-0.10 gives me all these:

typelibdir
datarootdir
exec_prefix
pluginsdir
datadir
prefix
libdir
includedir
girdir
toolsdir

Which are all at or under the correct /opt/local/ directory.

4

1 回答 1

0

您是否尝试过在 Eclipse 之外运行?

于 2013-03-19T15:27:08.147 回答