Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 290068 - VMARGS -Djava.library.path is rewritten
Summary: VMARGS -Djava.library.path is rewritten
Status: CLOSED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: unspecified   Edit
Hardware: All Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-21 16:14 EDT by William Bourque CLA
Modified: 2021-09-05 11:22 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William Bourque CLA 2009-09-21 16:14:29 EDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.14) Gecko/2009091010 Iceweasel/3.0.12 (Debian-3.0.12-1)
Build Identifier: 20090611-1022

Adding flags "-Djava.library.path" will not work, as this vmargs is rewritten during eclipse startup. Therefore, adding any "-Djava.library.path" is useless. 

The passed flag is shown in "About Eclipse -> Installation Details" but is clearly missing when calling "System.getProperty("java.library.path")"

To pass a "-Djava.library.path", a developper can : 
* Add the flag  -vmargs "-Djava.library.path=/somewhere" to the eclipse command line.
* Edit the file eclipse.ini in eclipse installation directly and add "-Djava.library.path=/somewhere"
* Probably some other ways...


The default -Djava.library.path lack important paths, as "/usr/local/lib", that are typically used in most system as default user-compiled library.
Note : the default 


Reproducible: Always

Steps to Reproduce:
1.Start eclipse defining a java.library.path. Example : ./eclipse/eclipse -vmargs "-Djava.library.path=/somewhere/that/exist/lib"
2.Create a new java project.
3.Create a new class in the project. Add the function stubs "public static void main String[] args" while creating.
4.Add the folowing line to the code and run it as a java application :
System.out.println(System.getProperty("java.library.path"));
5./somewhere/that/exist/lib will NOT be shown in the output.



* The default output "java.library.path" on my system shows a certain number of directory that does not exist, such as "/usr/java/packages/lib/i386". Complete output is as folowing : 
/usr/local/jdk1.6.0_13/jre/lib/i386/client:/usr/local/jdk1.6.0_13/jre/lib/i386:/usr/local/jdk1.6.0_13/jre/../lib/i386:/usr/local/jdk1.6.0_13/jre/lib/i386/client:/usr/local/jdk1.6.0_13/jre/lib/i386:/usr/lib/xulrunner-addons:/usr/lib/xulrunner-addons:/usr/java/packages/lib/i386:/lib:/usr/lib

* Adding a directory to LD_LIBRARY_PATH environnement variable will be reflected on the java.library.path. This is the workaround I currently use.

* It is possible to add a different java.library.path to VMARGS in the "run configuration" directly in eclipse. However, this is a somewhat a pain for project having large number of single file that need the additionnal java.library.path setted up.
Comment 1 Eclipse Webmaster CLA 2019-09-06 15:37:01 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 2 Eclipse Genie CLA 2021-09-05 11:22:07 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.