简体   繁体   English

Java控制台应用程序打开并运行JAR文件

[英]Java Console Application open and run JAR file

How to in Java console app run JAR file and get output of it and sent commands? 如何在Java控制台应用程序中运行JAR文件并获取其输出并发送命令? I need for creation controller of minecraft server. 我需要Minecraft服务器的创建控制器。 Normally is starting minecraft server with BAT file with this code: 通常是使用以下代码用BAT文件启动minecraft服务器:

java -Xms1024M -Xmx1024M -jar craftbukkit.jar -o true

PAUSE 暂停

How to I get this in Java console application using netbeans? 如何使用NetBeans在Java控制台应用程序中获取此信息? WITHOUT RUN CMD. 没有运行CMD。

java -jar <jar-file-name>.jar

But this will only work if you have created runnable .jar 但这仅在您创建了runnable .jar时有效

This has been answered here Run jar file in command prompt 这已经在这里得到回答在命令提示符下运行jar文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM