Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / November 2004

Tip: Looking for answers? Try searching our database.

JVM shut down ala Eclipse or Jbuilder

Thread view: 
Sambucus - 25 Nov 2004 16:15 GMT
Hi all,
anyone who knows how to force a running jvm to shut down like Eclipse
or Jbuilder does when you press their little stop button?

I have this problem with some sockets refusing to shut down (I guess
it is because they are blocking for input). When I run my app from
eclipse and use a normal System.exit(); or
Runtime.getRuntime().halt(0); the app refuses to shut down, however,
if I press eclipses stop/shutdown button it imideatly shuts down the
jmv and all sockets. I would like to know if there is some way to
implement this from within my app?

Any help much appritiated!

/Andreas
Ann - 26 Nov 2004 17:09 GMT
windows task manager

> Hi all,
> anyone who knows how to force a running jvm to shut down like Eclipse
[quoted text clipped - 11 lines]
>
> /Andreas
Sambucus - 27 Nov 2004 08:57 GMT
Ehh, yes of course, but that will not work for me I'm afraid.
I dont know if eclipse/jbuilder uses a native call to end the jvm
process? In that case it would be the same as using the task manager,
but can you implement that into a Java app?

> windows task manager
>
[quoted text clipped - 13 lines]
> >
> > /Andreas
Ann - 27 Nov 2004 17:22 GMT
> Ehh, yes of course, but that will not work for me I'm afraid.
> I dont know if eclipse/jbuilder uses a native call to end the jvm
[quoted text clipped - 18 lines]
> > >
> > > /Andreas
Use Runtime
Taskkill
Ends one or more tasks or processes. Processes can be killed by process ID
or image name.
Syntax
taskkill [/s Computer] [/u Domain\User [/p Password]]] [/fi FilterName]
[/pid ProcessID]|[/im ImageName] [/f][/t]
John English - 30 Nov 2004 12:14 GMT
> Ehh, yes of course, but that will not work for me I'm afraid.
> I dont know if eclipse/jbuilder uses a native call to end the jvm
> process? In that case it would be the same as using the task manager,
> but can you implement that into a Java app?

Try Runtime.exit() -- "terminates the currently running Java virtual
machine by initiating its shutdown sequence".

-----------------------------------------------------------------
 John English              | mailto:je@brighton.ac.uk
 Senior Lecturer           | http://www.it.bton.ac.uk/staff/je
 School of Computing & MIS | ** NON-PROFIT CD FOR CS STUDENTS **
 University of Brighton    |    -- see http://burks.bton.ac.uk
-----------------------------------------------------------------
Andrew Thompson - 30 Nov 2004 12:30 GMT
>> Ehh, yes of course, but that will not work for me I'm afraid.
>> I dont know if eclipse/jbuilder uses a native call to end the jvm
[quoted text clipped - 3 lines]
> Try Runtime.exit() -- "terminates the currently running Java virtual
> machine by initiating its shutdown sequence".

Which, according to the JavaDocs "The System.exit method is
the conventional and convenient means of invoking this method"

The OP mentioned earlier that invoking System.exit() was (amongst)
the current way of doing things.

[ Follow-Ups set to c.l.j.help. ]

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.