How to change command prompt (console) window title from command line Java app?

后端 未结 4 1126
南旧
南旧 2020-12-17 22:24

How to change and update the title of the command prompt window from the java command line application? Every time I run my application, the command prompt window title show

4条回答
  •  佛祖请我去吃肉
    2020-12-17 22:52

    following dlamblin's revelation ;-) here's a python code. note that there are 2 different commands in most programming languages:

    • system
    • exec

    system will issue a system command, exec indeed spawns a new process. thus:

    C:\>python
    >>> import os
    >>> os.system("title berry tsakala")
    

    which works inside a running program. Just find the java equivalent.

提交回复
热议问题