Hi,
Is it possible to close opened Window applications (like IE browser) using Java application.
How we can track and close.
Thank you,
Hari.
Printable View
Hi,
Is it possible to close opened Window applications (like IE browser) using Java application.
How we can track and close.
Thank you,
Hari.
Closing applications means killing the process from the system. It's quite difficult task in Java, with multiplatforms.
How is that possible Eranga? I'm curious of it
JNI could work.
Actually it's not possible. Say you open a URL in the browser with Java. But you cannot do anything with the browser, it's decide what to do with data passes by you into the browser. Simply Java has no control over that process.
Read more about destroy() method on Process class on Java DOC for how to handle unspecified situations.
I got a little confused, though I get the sense already.
By using the Process and ProcessBuilder, is it possible to store open processes displayed on the Windows Task Manager and manipulate the each process?
Okay then do this. Write a simple cord to open your browser. And execute it. After that do a slight modification to the code, added destroy() method as the last line of the code, and run your code again. What happen?
To analyze your statement, without coding it, the browser will just open and immediately close.
First couple of links should be enough: Java JNI
Much luck!
Sorry Fubarable, but I don't seem to connect your link with the thread.
But I get the sense that JVM could use the "Windows Language " to do this thread. But analyzing it could be a troublesome for a developer.
Just looking at the codes I have seen on the link(s) you've provided.
JNI is a way to link Java with native code, but I recommend you do a Google search on JNI and Java and the first two hits will tell all and far better than I can do.
In my experience directly only with Java it's not quite possible. C++ with Java is the most suitable, since I'm using those two for a long time :p
Ok. I will then post a thread pertaining on how this is made after I have concluded my current thread and project.
I am curious on how these became possible.
Yeah sure. Think about that how far it's possible to use destroy() in Process class. And also how to use JNI, with any native languages. How to connect them. And also how to handle those scenarios using a native language.