如何运行从我的Java应用程序的批处理文件? [英] How do I run a batch file from my Java Application?

查看:99
本文介绍了如何运行从我的Java应用程序的批处理文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Java应用程序,我想运行调用批处理文件 scons的-Q隐式DEPS改变的构建\\ file_load_type出口\\ file_load_type

看来,我甚至不能让我的批处理文件来执行。我的想法。

这是我在Java中:

 调用Runtime.getRuntime()EXEC(运行build.bat,空,新的文件(。));

previously我有,我想运行Python Sconscript文件,但因为没有工作,我决定,我会打电话通过批处理文件中的脚本,但这种方法一直没有成功,因为呢。


解决方案

 调用Runtime.getRuntime()EXEC(CMD / C开始的build.bat);

In my Java application I want to run a batch file that calls "scons -Q implicit-deps-changed build\file_load_type export\file_load_type"

It seems that I can't even get my batch file to execute. I'm out of ideas.

This is what I have in Java:

Runtime.getRuntime().exec("build.bat", null, new File("."));

Previously I had a python Sconscript file that I wanted to run but since that didn't work I decided I would call the script via a batch file but that method has not been successful as of yet.

解决方案

Runtime.getRuntime().exec("cmd /c start build.bat");

这篇关于如何运行从我的Java应用程序的批处理文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆