Shut down computer?

M

Mr Bit Fly

Is it possible to shutdown a user's computer from within Java?

YES !

You only need to localize the SO command to shutdown your computer and
execute it from java !!.

if you are trying to shutdown the computer from an applet this needs
to be signed

Regards
 
G

Greg R. Broderick

Is it possible to shutdown a user's computer from within Java?

On which of the many platforms that Java supports? Linux? Unix? Mac?
Windows? Java is a platform-independent language -- you write your code once
and it runs on every platform. Shutting down the OS/computer is a platform-
dependent operation -- it is done differently on each platform. To
accomplish this, you would need to determine the operating system using Java
system properties and call C/C++ code via JNI to actually do the system
shutdown.


Cheers!

--
---------------------------------------------------------------------
Greg R. Broderick (e-mail address removed)

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------
 
M

Mr Bit Fly

Well...

im not an orthodox or a conservative about Java, speaking loud about
his platform independency.

You can doit in java and it counts !!

The Power of java is about posibilities, not about the fool
conservative myths.
 
J

Joshua Cranmer

Mr said:
Well...

im not an orthodox or a conservative about Java, speaking loud about
his platform independency.

You can doit in java and it counts !!

The Power of java is about posibilities, not about the fool
conservative myths.

First off, I left that signature in there to emphasize an irony.

Second, I disagree with your reasoning. The point of Java was to try to
create a platform-independent model. This isn't about conservatism, it's
about trying to save others headaches when they try to run your program
from less common system.

Finally, you *cannot* do it in Java per se. The closest one can get is
to hack in a Runtime.exec call or use JNI; JNI requires use of another
language, and a Runtime.exec call at best assumes the presence of other
functions.
 
B

Benjamin

On which of the many platforms that Java supports? Linux? Unix? Mac?
Windows? Java is a platform-independent language -- you write your code once
and it runs on every platform. Shutting down the OS/computer is a platform-
dependent operation -- it is done differently on each platform. To
accomplish this, you would need to determine the operating system using Java
system properties and call C/C++ code via JNI to actually do the system
shutdown.
I was thinking something cross platform. Maybe something in the API?
 
G

Greg R. Broderick

You can doit in java and it counts !!

Please demonstrate (with real Java code) how one would shut down an IBM
system running AIX, using only java.

Cheers!

--
---------------------------------------------------------------------
Greg R. Broderick (e-mail address removed)

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top