Native library build path variables in Eclipse
I have shared eclipse projects that use a build path variable as a relative location for jar dependencies. So in the build path they appear as VARIABLENAME/subdirectory/blah.jar
. All developers have to do is define one variable in their workspace and all the projects build paths work.
The problem is that some of those jars also require the "Native Library Location" to be set. The DLLs are typically in the same location that the jar was in, but I cannot figure out a way to use VARIABLENAME
to reference the dlls location. Everything is relative to this variable, developers should only have to set this one variable instead of grinding开发者_运维知识库 out a huge User Library definition.
In your projects' launch configurations you can always (assuming a java application type of run/debug config), in the arguments tab, you can always add a line in the bottom textarea (vmargs)
-Djava.library.path=VARIABLENAME/subdirectory
assuming this is where your JNI libs are. The VARIABLENAME can be defined through the "variables..." (either as en env_var if you also define it as an environment variable or redefining the variable "edit...").
精彩评论