0

I developed a java application that needs to be run with additional arguments. Therefor I wrote a batch file that looks like this:

java -Djava.library.path=data\ -cp SLV.jar;lib\comm.jar slv.SLV

When I start the batch file witht that content, it opens java and shows me the output of the "System.out.println" method. But When I close the console, which opened the batch file, the java programm gets closed too. Is there a way to close the console window but keep the Java apllication running? I tried to use a vbs. Script to run the batch invisibly with that content:

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False

Then I used

wscript.exe "C:\Wherever\invisible.vbs" "C:\Some Other Place\MyBatchFile.bat"

But that doesn't work, so I wanted to see if there's a method directly implemented into the java runtime environment.

1
  • You mean a daemon/service? Does the application end after printing the message or is there some work to do in as for example in a server listening to something? Commented Jan 31, 2014 at 11:27

1 Answer 1

1

Use javaw.exe instead of java.exe. The console will never open.

Sign up to request clarification or add additional context in comments.

1 Comment

That works 50%! If I open the batch file the console window opens, but I can close it, and the java application keeps running. But I can't execute any other commands after that, because it seems the batch file waits for the java programm to finish... But I suppose thats's a new Problem :/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.