Today, I wrote a SWT tool independent of the RCP project, which needs to be started using batch processing. I even wrote a batch processing window without flashing dos. I think my colleagues are stunned. So I will share my experiences with you.
Many friends use batch processing in Windows to start their own Java programs,
The general statement is:
Run class:
Java xx
Run jar:
Java-jar XXX. Jar
However, a disgusting dialog box stops until we close the program.
So many people say they can do this.
Run class:
Start javaw xx
Run jar:
Start javaw-jar XXX. Jar
In this way, the DOS window will still flash. Does this solve the problem ?! Many people on the Internet say yes.
For those of us who are pursuing perfection, it is still unacceptable.
So the ultimate solution came into being!
Add @ echo off to the first line of batch processing.
In this way, our batch processing becomes
Run class:
@ Echo off
Start javaw xx
Run jar:
@ Echo off
Start javaw-jar XXX. Jar
Try it. It's never a flash. Hahaha.
Explain
Echo off
Indicates that the command line itself is not displayed for all running commands after this statement.
@ Indicates that this command line is not displayed during running
I think that when I was playing a game version D, the virtual optical drive was still a command line method. In order to make a game run normally, I often had to write a long batch of processing, at that time, such perfectionists realized the importance of @ echo off.
This proves how wise and great it is to say that it is to learn dos well.
Reprinted: