My setup is as follows: C: contains operating system and final release of programs Z: contains code I am working on
I have tried:
ProcessBuilder pb = new ProcessBuilder("java", "-jar", "Pim_Update_Client.jar");
pb.directory(new File("/TaxiPIM"));
and:
ProcessBuilder pb = new ProcessBuilder("java", "-jar", "Pim_Update_Client.jar");
pb.directory(new File("c:/TaxiPIM"));
and ended up google-e-eyed with results explaining how to change the directory...
But I need to change the drive as well as the directory.
Thanks for reading - feedback is most appreciated!
Edit: ProcessBuilders directory(File) method returns a new ProcessBuilder so try pb=pb.directory(new File("...)
crude way would be to export the command to a batchfikle in the same dir as your project and putting the change drive code into the batch file, too and then run the batch file from your code.
Example that changes from a directory on C to a directory on D; (i have my NetBeans installation and the project-directory on the C-Drive)
ProcessBuilder pb = new ProcessBuilder("cmd.exe","/c","start","cmd");
pb=pb.directory(new File("D:\\src"));
pb.start();