title: Use Eclipse classpath variable to replace absolute "sourcepath" path?
body: <p>I would like to use an Eclipse classpath variable to resolve the attached source JAR file for a library in my classpath. This is the contents of my current ".classpath" file in Elcipse (Indigo):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;classpath&gt;
    &lt;classpathentry kind="src" path="src"/&gt;
    &lt;classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/&gt;
    &lt;classpathentry exported="true" kind="lib" path="lib/ApacheCommons/commons-logging.jar"/&gt;
    &lt;classpathentry exported="true" kind="lib" path="lib/Spring-WS/spring-ws-1.5.8-all.jar"/&gt;
  
    &lt;!-- [other entries] --&gt;
  
    &lt;classpathentry kind="output" path="bin"/&gt;
  &lt;/classpath&gt;
  </code></pre>
  
  <p>When I now add a source JAR file for "spring-ws-1.5.8-all.jar", the ".classpath" files contents is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;classpath&gt;
    &lt;classpathentry kind="src" path="src"/&gt;
    &lt;classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/&gt;
    &lt;classpathentry exported="true" kind="lib" path="lib/ApacheCommons/commons-logging.jar"/&gt;
    &lt;classpathentry exported="true" kind="lib" path="lib/Spring-WS/spring-ws-1.5.8-all.jar"
      sourcepath="D:/dev/sources/spring-ws-1.5.8-sources.jar"/&gt;
  
    &lt;!-- [other entries] --&gt;
  
    &lt;classpathentry kind="output" path="bin"/&gt;
  &lt;/classpath&gt;
  </code></pre>
  
  <p>As you can see, Eclipse added the "sourcepath" attribute to the "classpathentry" element with an absolute path.</p>
  
  <p>Now my idea is to replace the absolute path with the classpath variable "SOURCE_PATH", which is correctly set to "D:/dev/sources".</p>
  
  <p>(Please, don't ask why we have this setup or suggest we must change it; it is an old project and we are unfortunately not able/allowed to change the build structure).</p>
  
  <p>I tried </p>
  
  <pre><code>sourcepath="SOURCE_PATH/spring-ws-1.5.8-sources.jar"
  </code></pre>
  
  <p>as well as</p>
  
  <pre><code>sourcepath="${SOURCE_PATH}/spring-ws-1.5.8-sources.jar"
  </code></pre>
  
  <p>but both variants do not work.</p>
  
  <p>I seems, that I either use the wrong syntax or I don't understand the concept of classpath variables. Maybe the classpath variable can't be used for the "sourcepath" attribute?</p>
  
  <p>Thanks a lot for your help!</p>