views:

95

answers:

3

In Windows, I made a small script to compile and then run a Java application:

javac helloWorld.java
java helloWorld

helloWorld prints "Hello, world!" and then the command prompt closes immediately. What I want to happen is for the program to execute then have a new line on the command prompt ready to go.

EDIT: 1 more stipulation. It needs to be just one batch file, not a batch file calling another one.

+1  A: 

you need to start an instance of cmd.exe and just let it run.

Dave Markle
+1  A: 

You could start the script like this:

cmd /K script.cmd

This will keep the cmd shell open.

You can accomplish this by creating a desktop shortcut with the given line.

tangens
+2  A: 

Append the line:

cmd

...at the end of your batch file.

tangens
pause is the correct command for this. Hacking the interpreter is not the way to do it.
Billy ONeal
cmd is actually what I asked for, now I realize though, pause is what I need, so thank you both!
Austin Kelley Way