英文:
Open Cmd with a jar file and execute the program
问题
我想从NetBeans的jar文件中打开我的cmd程序。
我们将称这个程序为"Super_Program"。该程序应该在cmd上运行,但我有一个jar文件,所以我该如何从jar文件中的代码打开cmd,并执行它?
英文:
Hi I want to open mi cmd program from the jar file of NetBeans
We will call the program "Super_Program". The program should be run on the cmd but I have a jar file so how can I open cmd from a code in the jar file that also executes it
答案1
得分: 1
使用ProcessBuilder在操作系统上执行命令。请参考这个示例:如何从Java执行Shell命令。
英文:
Use ProcessBuilder to execute commands on the OS. Please see this example on How to execute a shell command from Java.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论