Double-click bat and open jar in the CMD window (designed for Java programs without interfaces)

Source: Internet
Author: User

Note that although this is just a simple question, I have been exploring this cainiao for a long time ~~

Double-click to open a jar with no interfaceProgramAnd want to stay in the CMD window. Let's take a look at the system. Out. Print Information displayed by the jar program. Write a bat:

 

Java-jar test. Jar
Pause

 

For the above two lines.

The first line of text, needless to say.

The key is the second line, pause ~~

In the first line, everyone will. I tried it for a long time, but I was depressed and the window didn't show up. However, in the task manager, a javaw is still found, that is, the jar program is running.

In order to let the window stay, I tried again. I first opened the window with cmd and then executed the following command. However, I found that if the first line in bat is cmd, the latter will not be executed ~~ I don't know why

I think the CMD window will not disappear without executing the last bat command, so I tried to add a pause ~~~

Ha, very effective ~~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.