我尝试使用以下程序使用特定工作区打开eclipse,但它无法正常工作。
Runtime runTime = Runtime.getRuntime();
Process process = runTime.exec("eclipse.exe \"D:\\Research_&_development\"");
答案 0 :(得分:0)
使用-data path
指定工作区位置。
答案 1 :(得分:0)
使用此代码通过代码打开eclipse:
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) {
}
}
}
答案 2 :(得分:0)
当您希望Eclipse从命令行或shell执行中打开特定工作区时,您可以使用-data path\to\workspace
参数。
在您的情况下,您可以这样做:
Runtime runTime = Runtime.getRuntime();
Process process = runTime.exec("eclipse.exe", "-data \"Research_&_development\"");
但是,我建议一般使用绝对路径;你没必要,但我允许你以后轻松找到文件夹。