4
votes

Having read the post at .bat files, nonblocking run/launch,

I still cannot achieve what I need: to have the .BAT file close once the start command is executed. My problem is that when the JVM starts the application launches a window so I end up with 2 windows being opened, when in fact one of them (the .BAT command) is just a startup process and doesn't do anything meaningful to the user.

I paste the .BAT code here:

@echo off
setlocal
rem Starts the application

rem Check for Java Home and use that if available
if not "[%JAVA_HOME%]"=="[]" goto start_app
echo. JAVA_HOME not set. Application will not run!
goto end
:start_app
echo. Using java in %JAVA_HOME%
start "Application" "%JAVA_HOME%/bin/java.exe" -jar lib/pathToMyJarFile
goto end

:end

I'd like the .BAT process to terminate (or at least the window to close) once the JVM starts.

2

2 Answers

7
votes

Try javaw.exe instead of java.exe.