Take the 2-minute tour ×

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.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

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.

share|improve this answer
Thanks, very clear and helpful. –  user200340 Jul 13 '11 at 10:19
I am using eclipse. Could you please guide me to set LD_LIBRARY_PATH in the eclipse configuration? –  CODE FISH Jul 26 '13 at 10:37
In eclipse.ini, add -Djava.library.path=... after -vmargs stackoverflow.com/questions/13092003/… –  Aaron Digulla Jul 26 '13 at 11:29
I want to do the same thing, but for PERL not java. what should I type in my eclipse.ini , I am on Ubuntu. –  Mhd.Tahawi Jul 16 at 14:20
I think for PERL, you need a star script which sets LD_LIBRARY_PATH. –  Aaron Digulla Jul 16 at 15:04

Your Answer


