0

I want to know how can I run a another java console application (jar1) inside another java application (jar2) also I want to be able to see jar1 outputs and insert my own inputs from jar2.

Let me explain more. there is a program called spigot (see more in www.spigotmc.org): Spigot is CLI java program for running a minecraft server and you have to run it with launch flags in a bat file in windows server like: java -Xmx 1024m -Xms 1024Xms spigot.jar1. Now I want to make a program which let me to running this on my own graphical design not in a console.

How can I pass arguments to an existing command window?

Unihedron
  • 10,902
  • 13
  • 62
  • 72
Peyman
  • 21
  • 3

1 Answers1

1

Run a new program with ProcessBuilder. You cannot modify arguments in any already running program, so terminate them first.

Unihedron
  • 10,902
  • 13
  • 62
  • 72
  • Could you give an example? Also, can you pass commands/arguments after you ran the builder? Because you enter your commands in the constructor, and that's the only time the show up :/ – Cardinal System Apr 26 '17 at 21:05
  • `ProcessBuilder` is used to run a new program, I'm not sure what's ambiguous about it. An example is already in the documentation within it and any I give would be less accurate than the official demo. – Unihedron Apr 29 '17 at 13:22