Hi people! Sorry for the dumb question. How to close the console from which the java application was called?

I created such .bat file:

java -jar Application.jar

Run it. He runs my app. I get out my JFrame. And the console remains until I close this Jframe. If I close the console, the application also closes.

The main code is

public static void main(String[] args) { frame = new SomeFrame(); frame.enterHowUnregistred(); frame.init(); frame.setSize(884, 595); frame.setLocationRelativeTo(null); frame.setVisible(true); } 
  • 2
    probably nothing. Because, in the terminal, a session is opened in which a java application was launched. If you terminate the session ahead of time, then with it all applications running in it stop working. - Artem Konovalov
  • 2
    It is necessary to run through the start command. Then the console itself closes. C: \> start /? Run the specified program or command in a separate window. c:\>start java -jar Application.jar - Sergey
  • @Sergey, it will be great if you write this with the answer. - Nofate

2 answers 2

I rummaged through the internet and found it: the point is that the console will close almost immediately and leave only your application:

 start javaw -jar Application.jar 

While it is necessary to perform it through javaw

    Use the start command before

     java -jar Application.jar.