使用java在Eclipse中执行.sh文件

时间:2013-03-26 17:47:55

标签: installation sh silent

公共类TestNetbeans {

public static void main(String[] args) {
    try {
        ProcessBuilder processBuilder = new ProcessBuilder(
                "./netbeans-7.0.1-ml-linux.sh", " --silent");
        // ProcessBuilder("./netbeans-7.0.1-ml-linux.sh"," --silent"," -J-Dnb-base.jdk.location=/home/nayum/Documents/jdk1.6.0_23/jre");
        Process process = processBuilder.start();

        process.waitFor();


    } catch (Exception e) {
        System.out.println(e);
        e.printStackTrace();
    }
}

}

此代码在命令提示符下执行时,对于netbeans的静默安装工作正常,但在eclipse中执行时,其执行将终止。问题和解决方案是什么?

0 个答案:

没有答案