0

I have a batch file which looks like

start "Java" "C:\Program Files\Java\jdk-12.0.1/bin/java.exe" <various classpaths and parameters>

Until recently it started up the Java executable and the command window vanished. Now the window stays there until the Java program has finished. If I close the command window the Java program is also terminated, which is a bit of a nuisance.

This only seems to happen with the Java executable - I tried it with Notepad and it worked as expected. So it may be connected with my previous question about the interaction of Java and Windows: Running Java using a junction for the executable's folder does not work

Any ideas why and how to get the original behaviour back? I've no idea what changed, except for my installing a more recent version of Java.

4
  • 1
    See if this helps, it is a workaround that runs the console hidden.....robvanderwoude.com/battech_hideconsole.php
    – Moab
    Commented Oct 7, 2019 at 15:05
  • Well, start /MIN it certainly minimises the window, but which is a help, but doesn't remove it as I'd have hoped.
    – Peter
    Commented Oct 7, 2019 at 15:12
  • 1
    What does adding Exit at the end of the batch string (on another line) do?
    – Moab
    Commented Oct 7, 2019 at 15:18
  • @Moab, Interesting. I think I might have worked out the problem. Adding an "exit" makes no difference, except that there was a very short time when there were two command windows open. The first one disappeared and the second one stayed as before. Originally, the (only) command window had some output from the Java executable. Now the second one has that output. So it looks to me as if the Java executable is now opening its own command window for output, and that's what I'm seeing. Changing your "exit" to "pause" shows both windows.
    – Peter
    Commented Oct 8, 2019 at 17:06

0

You must log in to answer this question.

Browse other questions tagged .