Possible Duplicate:
Shutting down a computer using Java
I am making a personal program that will shut down my computer after a certain amount of time or at a certain time/date. However, I am running multiple operating systems and want to do this with one simple Java program. Is there any way to send a system-independent machine shutdown request in Java without any using any external libraries? I know you can use java.awt.Desktop.getDesktop().browse(new URI("shutdown /s")); in Windows, but, again, I want system independence.
@robjb gave me the best solution. Though it is a little too inflexible for my tastes, I will be suing it until I run into a problem.
In the above example,
StringPPis a custom class that augments the capabilities of aStringwith methods such as the above used#containsIgnoreCase.Main.LOGis a logging utility that I made and use.