Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
892 views
in Technique[技术] by (71.8m points)

java - Eclipse with $LD_LIBRARY_PATH

I have some library files built using JNI in the directory /usr/local/lib/.

If i start the Eclipse from luncher, the path is never picked up by Eclipse, so I need to specify -Djava.library.path to the Run Configurations.

But if I start the Eclipse from command line. It seems working fine.

Does anyone know why it behaves like this and How to configure it to known the /usr/local/lib/ path from luncher. Thanks.

I am using Eclipse SDK Version: 3.6.2, on Ubuntu OS.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

That is probably because your shell executes export LD_LIBRARY_PATH=... in one of the startup scripts.

The launcher doesn't run those, so the variable isn't set.

The workaround: Write a small script that sets LD_LIBRARY_PATH and starts Eclipse (use exec eclipse if you want to avoid a useless process hanging around until Eclipse exits).

Alternatively, edit eclipse.ini and add -Djava.library.path=... after -vmargs

To verify that this works, open Help / About Eclipse / Installation Details / Configuration. The path should show up in the dialog as a System property.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...