eclipse - Java Build Path - Add External JARs' and Add Variable -
what difference between java build path - add external jars button , add variable button functionality, why required. please explain in detail.
both can used achieve same thing: add jar build path.
suppose have project p1 wants use jar installed supplier s1, happens located @ c:\s1\aproject\jars\useful.jar
client add external jars, navigate, select, , we're done.
but, consider these cases.
1). suppose have several projects want use same jar? end repeating projects p1-pn. gets dull. what's worse, suppose install new version of s1's stack, need update project's build paths reference
c:\s1\aproject-**v2**\jars\useful.jar
and what's worse, if miss 1 running 2 versions of jar may bad!
2). share project colleage happens have s1 product installed in different location. need amend project point to
e:\myfavouritethings\s1\aproject\jars\useful.jar
and if using scm may tread on each others toes.
so:
instead add variable allows define workspace variable (ie. specific environment) can used reference jar
$(s1_jars)\\useful.jar
now single place update new version of s1, , each developer can set own value s1_jars.
i recommend using variables non-trivial development scenarios.
Comments
Post a Comment