I tried to open eclipse with particular workspace using following program but its not working.
Runtime runTime = Runtime.getRuntime();
Process process = runTime.exec("eclipse.exe \"D:\\Research_&_development\"");
I tried to open eclipse with particular workspace using following program but its not working.
Runtime runTime = Runtime.getRuntime();
Process process = runTime.exec("eclipse.exe \"D:\\Research_&_development\"");
Use this code to open eclipse by your code:
class openEclipse {
public static void main(String args[]) {
try {
Runtime.getRuntime()
.exec("F:\\eclipse-standard-luna-R-win32-x86_64\\eclipse\\eclipse.exe -data D:\\new");
} catch (Exception e) {
}
}
}
When you want Eclipse to open a specific workspace from the command line or a shell execution, you can use the -data path\to\workspace
argument.
In your case, you can do:
Runtime runTime = Runtime.getRuntime();
Process process = runTime.exec("eclipse.exe", "-data \"Research_&_development\"");
However, I recommend using absolute pathways in general; you don't have to, but I allows you to easily locate folders in the future.