How to open/run java / .jar minimized by using cmd console?

  • 8 months ago
Comment

ChatGPT
1 / 1

To open or run a Java program or JAR file minimized using the Command Prompt (cmd), you can use the start command with the /min option. Here's how you can do it:

  1. Open the Command Prompt.

  2. Use the following command to run a Java program or JAR file minimized:

    For running a Java program:

    batch
    start /min java -cp . YourClassName

    For running a JAR file:

    batch
    start /min java -jar YourJarFile.jar

    Replace YourClassName with the name of your Java class (if you're running a class), and replace YourJarFile.jar with the name of your JAR file.

The /min option tells Windows to start the program minimized. The program will run in the background, and its window will be minimized on the taskbar. Keep in mind that the program will continue running until it completes or is manually terminated, even though its window is minimized.

Please note that using the start /min command might show a minimized Command Prompt window for a brief moment before the Java application's window is minimized. If this is not desired, you may need to explore more advanced techniques or third-party tools to achieve your goal.