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?

2
  • 2
    stackoverflow.com/questions/15218892/… Commented Mar 29, 2017 at 21:30
  • but i need lunch flags too inside my program. i cant see any lunch flag in this Commented Mar 29, 2017 at 21:34

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

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 :/
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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.