After hours of unsuccessful googling, I ask you:
Situation:
My Eclipse Project uses "nedded.jar" so I added it to the build path. No problem.
But the location of "nedded.jar" is relative to the environment variable DEVELOPMENT ( =C:/dev/development/ ) and therefore may change. So, I need my Referenced Library path to be:
I could not find the syntax to accomplish that. Ideas?
EDIT:
Maybe I did not make myself clear enough: This Project is developed by MSVisual Studio(C++) and Eclipse(Java). Both are started from the Console. A prior executed script sets 3 major variables: DEVELOPMENT, RUNTIME, SOURCES to certain, changing paths.
If I then start Eclipse from this shell, the path to my external libs shall be defined by %DEVELOPMENT%\my_needed\nedded.jar.
I have found a half way solution (somewhere): added a new folder --> advanced --> link to alternate location (linked folder).
this adds you an entry in your .project, which I also get, when I checkout my project:
<linkedResources>
<link>
<name>lib/RXTXcomm.jar</name>
<type>1</type>
<locationURI>PARENT-4-PROJECT_LOC/Development/rxtx/RXTXcomm.jar</locationURI>
</link>
</linkedResources>
Nice so far, but it still does not depend on %DEVELOPMENT%. What I need is: %DEVELOPMENT%/rxtx/RXTXcomm.jar
Hope this is now clearer.
You should declare a variable (Java Build Path -> Add Variable... -> Configure Variable ... -> New) to set the changing path on each system (e.g. FOO_BAR_HOME).
Then you can add the variable to the Libraries section and edit it to point to your library, like:
%FOO_BAR_HOME%/lib/foobar.jar
Take a look at the existing variables for usage.
Alternatively you can place the library inside the project (e.g. subfolder 'lib'). If you add the library from this location ('Add Jars...' NOT 'Add External Jars...') it will be added by relative path.