Launch .jar files with command line arguments (but with no console window)

后端 未结 3 1337
春和景丽
春和景丽 2021-01-18 03:09

I have to do a demo of an application, the application has a server.jar and client.jar. Both have command line arguments and are executable. I need to launch two instances o

相关标签:
3条回答
  • 2021-01-18 03:53

    Alright after tring and cring, here goes my soluction

    @echo off
    start /B javaw -jar -Xms16m -Xmx512m client.jar
    @echo on
    

    I hope it will be usefull for somebody.

    0 讨论(0)
  • 2021-01-18 03:55

    Try:

    javaw <args>
    
    0 讨论(0)
  • 2021-01-18 04:12

    Found the solution, below is the contents of my batch file

    @echo off
    
    start /B server.jar [arg1] [arg2]  
    start /B server.jar [arg3] [arg4]
    
    start /B client.jar [arg5]
    start /B client.jar [arg6]
    
    @echo on
    

    this opens, runs all the commands and closes the window, does not wait for the command to finish.

    I am still not sure how to prevent the window from opening completely.

    0 讨论(0)
提交回复
热议问题