File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How Can I use java to invoke bat? but java is close Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How Can I use java to invoke bat? but java is close" Watch "How Can I use java to invoke bat? but java is close" New topic
Author

How Can I use java to invoke bat? but java is close

endswel shui
Ranch Hand

Joined: Jul 03, 2008
Posts: 33
How Can I use java to invoke bat? but java is close.

In eclipse, if I use the Runtime.getRuntime().exec() to invoke a bat, and the bat is there, i dont close it,

and I close the java app.

but the taskmanager also contains a java.exe which monitors the bat.

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38851
    
  23
I am not sure I understand the problem; please explain more.

I think this post is too difficult for “beginning”, so I shall move it.
endswel shui
Ranch Hand

Joined: Jul 03, 2008
Posts: 33
Campbell Ritchie wrote:I am not sure I understand the problem; please explain more.

I think this post is too difficult for “beginning”, so I shall move it.


ok, you can move it to other place.

the problem is we use the jre5 in real product.

and we develop a desktop application, embed tomcat 5.5 to start the app, we open the tomcat server port is 8689
but when we use the to run another local bat or application.
after that, we will close the main application,
but close the main application is ok, all seems closed. and the embed.stop() is invokded too.

after we type the netstat -ano|findstr "8689"
there is a record in the windows 7 32/64.
only can see the 'PID', but cant see the 'IMAGE NAME'

I think that is the jre5's issue or not
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38851
    
  23
Don’t know myself. Sorry.

I presume there is nothing in the Runtime documentation or links like Michael Dacosta’s article to say that exec() starts a new thread which runs independently of the JVM?
endswel shui
Ranch Hand

Joined: Jul 03, 2008
Posts: 33
Campbell Ritchie wrote:Don’t know myself. Sorry.

I presume there is nothing in the Runtime documentation or links like Michael Dacosta’s article to say that exec() starts a new thread which runs independently of the JVM?


yes, I read that also when try to solve this issue.

but it cant. in windows xp, it is ok.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38851
    
  23
Still don’t know. But do you mean that it runs all right in WinXP and not in other versions of Windows®?
endswel shui
Ranch Hand

Joined: Jul 03, 2008
Posts: 33
Campbell Ritchie wrote:Still don’t know. But do you mean that it runs all right in WinXP and not in other versions of Windows®?


yes, WinXP 32 bit is OK
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How Can I use java to invoke bat? but java is close