Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JVM shut down ala Eclipse or Jbuilder

Reply
Thread Tools

JVM shut down ala Eclipse or Jbuilder

 
 
Sambucus
Guest
Posts: n/a
 
      11-25-2004
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
 
Reply With Quote
 
 
 
 
Ann
Guest
Posts: n/a
 
      11-26-2004
windows task manager

"Sambucus" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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



 
Reply With Quote
 
 
 
 
Sambucus
Guest
Posts: n/a
 
      11-27-2004
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?

"Ann" <(E-Mail Removed)> wrote in message news:<XqJpd.568123$mD.208134@attbi_s02>...
> windows task manager
>
> "Sambucus" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
> > 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

 
Reply With Quote
 
Ann
Guest
Posts: n/a
 
      11-27-2004

"Sambucus" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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?
>
> "Ann" <(E-Mail Removed)> wrote in message

news:<XqJpd.568123$mD.208134@attbi_s02>...
> > windows task manager
> >
> > "Sambucus" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed) om...
> > > 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

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]


 
Reply With Quote
 
John English
Guest
Posts: n/a
 
      11-30-2004
Sambucus wrote:

> 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 | (E-Mail Removed)
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
-----------------------------------------------------------------
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      11-30-2004
On Tue, 30 Nov 2004 12:14:29 +0000, John English wrote:

> Sambucus wrote:
>
>> 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".


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. ]

--
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If you try the JBuilder Enterprise trial, you won't be able to run Turbo JBuilder afterwards Ramon F Herrera Java 6 11-11-2007 06:27 AM
JBuilder 2005 - JBuilderW fails but JBuilder runs from dos box?!? davout Java 1 03-06-2005 02:38 AM
Shut down Windows XP - order which it shuts down applications Bun Mui Computer Support 2 05-16-2004 09:10 PM
Are singletons held in memory until the JVM is shut down? Soefara Java 4 11-18-2003 05:50 PM
Won't power down when shut down Ray Horton Computer Support 2 08-27-2003 07:29 PM



Advertisments