Shutdown computer using java?

is it possible to shutdown or restart computer using java?if yes, is it an easy code?

naruto8 wrote:
i haven't tried it yet but i saw it in a forum from some site, it's using shell...
don't worry i'll try it..
i thought people here are nice so i try to ask question and it's actually answered most of the time...
by the way, with my question, a simple YES or NO would be fine!!!You might think we're being rude, but that's not the case. For a great number of questions people ask here, the far better approach would be to use a search engine. For simple "how do I do this?"-type questions, it would take you a matter of seconds to find an answer on Google, compared with possibly hours, possibly not even getting an answer at all, asking here. Being able to do this yourself is an invaluable skill that all programmers should have. Writing software is difficult, and you'll hit loads of problems along the way. Imagine how long it would take you to solve them if you waited for an answer on a forum for them all. The forums are a better resource for when you've tried something, and simply can't work out why it doesn't work, that sort of thing. For API calls (Java or otherwise) documentation and the like, asking a forum is the least effective way of you getting an answer to your question

Similar Messages

  • Finding drives of computer using java

    Hello All,
    I am writing "explorer" using java . I am unable to find API that will
    let me find the drives of a pc. E.x :- c:\ d:\ etc...
    A computer can have any number of drives .
    Please tell me what I should do.
    Any help will be appreciated. Thanks in advance
    sameer

    Try the listRoots method in java.io.File .

  • Is it possible to shutdown the computer using java?

    If any of you knows, please tell me thanks!

    Anione who can answer me with an example will get 10 Duke Dollars. plssss.... tell me...

  • Window shutdown when using java

    Greetings, since a short time i've having probs when using the java.
    For a time all goes well, but then the IE window just shuts down.
    No warning or whatever....
    Anyone any ideas?
    Tnx in advance

    Possible a bug, probably and more likely something is corrupted. Not much you can do short of trying to reinstall if there are really no errors or dumps present. You should look in your System -> application log file first to see if there are in fact errors you are not seeing.

  • Need help with Socket prog using Java wireless toolkit

    Hi, I am not able to communicate between client (Palm emulator) and server (Java on computer) using Java Wireless toolkit.
    Can anyone please tell me a site that shows an example. I have seen a bunch of examples but they all run by importing com.sun.kjava which seems to have vanished into thin air. So I cannot run them. Someone please show me some lines of code that will send just one character from client Palm emulator to server. thanks.
    Syed

    hi,
    I hope that you already have the J2ME Toolkit and that your emulator works okay. In the toolkit you get several examples to show you how to program a MIDlet. One has to do with a HTTP client server connection. Also in the API documentation for the J2ME there is a Connector class that you used to set up this communication and in the description of this class it pretty thoroughly explains how to set up an HTTP protocol client.
    However, if you want to do some other kind of networking then you are pretty much out of luck, as the TCPIP socket protocol has not been fully implemented and is optional to the J2ME specifications, only the HTTP protocol is certain to be available. This means that mobile phone companies can add other networking functionality to their phone's java virtual machine if they feel like it. This is a bummer I know.
    I hope this helps.
    Cheers,
    Mark

  • HT1338 I need to bulk upload to Auctiva (auction software) but Java was disabled on my computer. I have 10.5.8 so does this mean that I can't use Java? If not, then is there a workaround to be able to use the bulk uploader from Auctiva?

    I need to bulk upload images from iPhoto to Auctiva (auction software) that will then be posted to eBay; however Java was disabled on my computer some time ago due to "known issues."  I have 10.5.8 so does this mean that I can't use Java? If not, then is there a workaround to be able to use the bulk uploader from Auctiva? As it stands now, I have to upload photos individually which is super time consuming.

    You can re-enable it for special purposes, opposite of disabling it...
    Disable Java in your Browser settings, not JavaScript.
    http://support.apple.com/kb/HT5241?viewlocale=en_US
    http://support.google.com/chrome/bin/answer.py?hl=en-GB&answer=142064
    http://support.mozilla.org/en-US/kb/How%20to%20turn%20off%20Java%20applets

  • HT5243 How does one know if they use "java applets"? What do they do? How will I know if I need to 'disable the java web plug-in browser' if I do not use them? ( I'm not very literate in computer-speak.

    How does one know if they use "java applets"? What do they do? How will I know if I need to 'disable the java web plug-in browser' if I do not use them? (Obviously I'm not very literate in computer-speak.)

    Well, when you go to a web page a section of the web page will have a coffee cup picture where the java applet will run. The applet loads then runs. If you are not seeing this behavior then you are not using java. If it make you feel more comfortable then disable the browser java plugin. On my machine I have not disable java- but you
    may what to.

  • Window programming using java

    hi,
    can anybody suggest me how to go with widow API using java?
    say like if i want to shutdown my computer after pressing the button.
    thanks in advance,
    sachin

    Given the platform-independant nature of Java, I'm not sure there's a way to program Windows directly using it. Certainly there's no Java methods for this.
    However, it is possible to wrap windows dlls and access them from java, and this is probably the route you'll have to take. It's not particularly easy, but it's effective.
    I remember there being an article on gamelan.com about this, sorry don't have the link anymore - you'll have to search.

  • How to display Map for viewing in browser using Java

    I am fidning a solution for displaying political maps in browser using Java technology.
    Is ther anybody with a solution.
    Waiting for your respone.
    Regards
    Mithun

    palanithendral wrote:
    Hi,
    Our application using in English, German, Franch and chinese.You have several different idioms in your application and have not accurately identified where the actual problem is. You have all of the following
    -database
    -http
    -excel
    -excel in http
    -display on the target computer
    The first step with these sorts of problem is to identify where the problem actually occurs.
    String chineseCharacter=""; // chineseCharacter like 長长牀床東东彿佛. This chinese data coming from oracle database..A good theory. Now explain how you proved that that is what is coming from the database.
    After export the data to excel show the result for 長长牀床東东彿佛.As another example. Presumably you are referring to what the browser on the target computer displays. Your theory is that that computer and that browser (together) will display the correct information if they had the correct data. How did you prove that?

  • Using Java 6 classes with Java 5

    I ran into a little problem with the portability of Java (ironic eh?) across computers. The program I wrote on my home computer uses GroupLayout for the GUI. However, much to my surprise, the computers at my school only had Java 5 installed so the program could not run (GroupLayout is a class found only in Java 6). Is there any way to somehow package the GroupLayout class into my program?

    C_Zhao wrote:
    I ran into a little problem with the portability of Java (ironic eh?) across computers.Not as ironic as you might think.
    The program I wrote on my home computer uses GroupLayout for the GUI. However, much to my surprise, the computers at my school only had Java 5 installed so the program could not run (GroupLayout is a class found only in Java 6). Is there any way to somehow package the GroupLayout class into my program?Technically, yes, but I'd imagine that rewriting your code to use a different layout manager (such as one of those available in J2SE 5) would be quicker / easier. In fact, I'm almost willing to guarantee that refactoring would be easier than repackaging.

  • Need help with tomcat 5.5 and using java classes

    hey there,
    i am trying to set up tomcat 5.5 on my computer at home and have sucessfully done so. i have been trying to use Java classes inside my JSP files however tomcat thows an internal servlet error as follows:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 144 in the jsp file: /order.jsp
    Generated servlet error:
    ProductList cannot be resolved to a type
    An error occurred at line: 144 in the jsp file: /order.jsp
    Generated servlet error:
    ProductList cannot be resolved to a type
    An error occurred at line: 144 in the jsp file: /order.jsp
    Generated servlet error:
    Product cannot be resolved to a type
    i have the classes located as the setup tutorial recommends (root/WEB-INF/classes/) and still nothing works. i would appreciate any help anyone can give.
    thanks,

    Which tutorial are you following?
    As of java1.4, all classes must be in packages for them to work in Tomcat. This means your beans and servlets too.
    Put your beans in a package, and then recompile them, and put them in the right place.
    eg
    package com.mypackage
    public class MyClass ...
    once compiled would go into WEB-INF/classes/com/mypackage/MyClass.class
    Are you using Product and ProductList classes in scriptlet code?
    Have you imported them with a page directive
    <%@ page import="com.mypackage.Product, com.mypackage.ProductList" %> ?

  • If RuneScape uses Java 3D why don't you need to install it?

    I was just wondering if RuneScape uses Java 3D, why doesn't anyone need to install it? Is it because the game is intirely server side and all the graphics and stuff is done over on their servers and not on your own computer? Thanks.

    Most likely, you have a web plugin that depends on the Java runtime distributed by Apple, such as the Facebook video calling plugin or the "NexDef" plugin for watching baseball streams. If you no longer need the plugin, remove it, including its automatic update mechanism (if any) according to the developer's instructions. Otherwise, install Java.

  • Make firefox use Java 5

    My computer uses windows 98se and the latest version of Java that will work on this machine is 5 22. I can not update to a higher Firefox or Java or OS. How can I make my fire fox 3 6 28 work with java 5. It always says that my plug in is blocked and I can not enable it.

    I tried the link "How to enable Java if It's blocked". First there is no option to "Click here to activiate the Java" and there is no Red Plugin Icon. So this link does not help at all.
    Mike

  • Dynamic Programming Using Java

    hiiii...anyone knows how to use a dynamic programming to compare a mouse movement using java??? i hope some one can help me......

    This was just an idea. I do not know of any program
    implementing this. I will not help you store coordinates
    into a database, but I can explain my suggestion in
    more detail.
    Since the characters might be more dependent on the page
    then the user, you must make a sub character for each page.
    Your table row must then contain following fields:
    user, time, page, x-cord, and y-cord.
    Now assume following
    - we will use the characters 'average speed' and
    'centre of gravity of movement'.
    - we have two sessions of data, that is two sets of table
    rows as described above. Every set belongs to different
    users.
    - the sessions are spread on a set of pages.
    Now we will compute the distance between these users. There
    are a lot of distance metrics but let us choose the most
    common one. Let P be a set of points in R^n and p.n
    be the n coordinate of the point p in P. Then for any p1
    and p2 in P, define the distance metric to be
    D(p1,p2) = summa_{over n} (p1.n-p2.n)^2
    Define the average speed for a certain user and page to be
    Speed(user, page) (in) R. Further more let
    Gravity(user, page) (in) R^2 be the centre of gravity of
    movement for a user and page.
    Then the total distance is
    D(user_1, user_2) = summa_{over all pages} k1*D(Gravity(user_1, page), Gravity(user_2, page)) + k2*D(Speed(user_1, page), Speed(user_2, page))
    where k1 and k2 are constants determines the importance
    you want to assign the two characters.

  • Atomic disk writes using Java, is it possible??

    Hi, I need to do atomic disk writes using Java, is that supported/possible? And if, how is it done?
    With a atomic disk write I mean that if I write to a file all information should be written or none at all, not just some of the data. (In case of a program crash or other failures in the computer)
    /Fredrik

    you can store all the information in an object..and when you are sure you have all you need, you write all the data in one step to a file...
    but there is never a 100% guarantee.. you can check after the writing process if the size is correct or such things..

Maybe you are looking for

  • Reporting Services Compiler Error

    Hi All, I'm trying to run a report in MRS that I've created and get the following when I debug or try to run the report: Error 1 [rsUnexpectedCompilerError] An unexpected error occurred while compiling expressions. Native compiler return value: '[BC4

  • Lookout opc problems

    I am using Lookout 6.0.2 on a new Win XP desktop.  The Lookout OPC client object is used for communications via Rockwell Software RSLinx's (Professional Rev 2.43.01.23) OPC server to ControlLogix PLC's over ethernet.  In other words, the Lookout comm

  • How to identify the hidden columns in table by using af:panelCollection

    Hi, We are using af:panelCollection tag for a table to show personalization features. i.e. to hide or disaply colums in the table. We also have a print button to print data in the table. the issue is when we hide any column in teble using the persona

  • WCS Rogue AP Alarms

    Over the weekend, I moved a bunch of rogue APs into the "Unclassified Rogue AP" group that I felt were not interfering with my network because they were being detected at -80 and above. When I arrived today, I was surprised to find all of those alarm

  • Import multiple libraries?

    I found iPhoto was getting really sluggish a few years ago, so i split the libraries up to improve. Now with an SSD, and with hopes of the new Photos performing better, wondering if anyone has any advice on consolidating multiple libraries back to on