If you have not already, read the answer provided by Gilles here:
In short (to make some redundancy) the -X
option expects a command. That is: a screen
-command, not a shell/system command.
You could use the stuff-command. I.e.:
screen -X stuff 'java -Xms2048m -Xmx2048m -jar mcpc.jar
'
If you omit the command the target screen should respond with an error like:
-X: unknown command 'java -Xms2048m -Xmx2048m -jar mcpc.jar'
in the running screen window.
Notes:
- At least here, I have to use double new-line at end of command. (Like example above).
- As an alternative you can add the control character
^M
, typically Ctrl+V Enter in Vim, bash etc. That inserts<CR>
, byte0x0d
. mcpc.jar
must be in local path or provided by full/relative path.