executing a jar which is in another directory
<p>I am facing a little problem of directory changing in </p>

<pre><code>Process process = Runtime.getRuntime().exec(cmdlink);
</code></pre>

<p>I am running an executable jar file say test1.jar from testmanager.java. I have been working eclipse IDE and till now i saved the test1.jar in the present working directory of testmanager.But now i created a sub folder in testmanager called executables and placed the jar file in it. And when i use my regular code</p>

<pre><code>cmdlink = "java -jar test1.jar" + " " + cmd;
Process process = Runtime.getRuntime().exec(cmdlink);
            BufferedReader reader = new BufferedReader(new InputStreamReader(
                    process.getInputStream()));
</code></pre>

<p>ofcourse it wont work! because the exec tries to execute the command in the present working directory i.e. c:\users\blah\workspace\testmanager<br>
but i want it to got to 
c:\users\blah\workspace\testmanager\executables and then run the command.</p>

<p>Any help or suggestion is appreciated.</p>

<p>Thanks in advance!</p>
