Stop Running Programs with Java

Does anyone know how to stop a non-Java program that is currently running on a PC?

Hi,
did you started the programm from your java app with proc = Runtime.getRuntime.exec()?
If yes, you can kill it with
proc.destroy()If not, there is no platform-independent way to do it.
Best regards,
Martin

Similar Messages

  • Trying to run programs with java 1.4.2_07 after upgrading Eclipse

    Hi All,
    I'm using Eclipse version 3.1.0 and java 5.0 (1.5.0_03). I changed the JRE of a program back to 1.4.2_07, but when i try to run it i get this:
    Exception in thread "main" java.lang.UnsupportedClassVersionError: controller/Controller (Unsupported major.minor version 49.0)
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)What the %^#@ ? Will appreciate any help.
    Regards,
    snayit

    Also, another thing people may want to try. A coworker was having a problem where she kept getting the unsupported major minor version error from eclipse after upgrading to the latest version of java.
    All the configuration settings were correct, pointing to the latest vm. I tried starting eclipse with the parameter
    -vm "C:\Program Files\Java\jdk1.5.0_04\jre\bin\javaw.exe"
    and it worked just fine. Without this, it was apparently finding some conflict between jdk1.5 and the older jdk1.4.
    IDE's are nice, but I find configuring them after an upgrade to be exremely painful.

  • How to start and Stop Running services with Java Programme

    I have some Service Runinig on My Windows machine like Tomcat Server,i want to update some file in Tomcat server through java program ,it works only when my tomcat stops ,I want to write peice of Code so that i can stop service with my prog and start after updating my files

    heres something that may help yeah
    http://wrapper.tanukisoftware.org/doc/english/introduction.html

  • How do I stop running programs.

    I am using my Imac for recording purpose so I would like to stop the programs which are not needed.that may be running in the background.On my pc I go to the tak manager & find what is running.Is there a task manager type thing where I can go & stop running programs that use up CPU & cuase clicks & noises during recording.

    You can use the Activity Monitor located at the Applications/Utilities.  You can also access this by simultaneous pressing on your keyboard the following keys: Command Option and Esc.  That would prompt you to a window called Force Quit.  There you would see  applications that are running.
    Another option is like what is stated above, that you can see in your Dock what applications are running.  You would see a little blue shining circle/oval below the open applications.  Just left click for 1-2 sec the icon of the program you want to close and click on Quit.
    Hope this would help you and good luck with your recording!

  • Cannot run program "keytool": java.io.IOException

    Hi,
    I would like to follow the procedure to change the master password
    of glassfish server hosting APEX listener
    using the change-master-password subcommand, but the utility keytool
    is not found:
    glassfish@ahost:/opt/glassfish3/glassfish/domains/mydom01/config> /opt/glassfish3/bin/asadmin
    /opt/glassfish3/bin/asadmin
    Use "exit" to exit and "help" for online help.
    asadmin> change-master-password mydom01
    Enter the current master password> changeit
    Enter the new master password> changedit
    Enter the new master password again> changedit
    Cannot run program "keytool": java.io.IOException: error=2, No such file or directory
    Command change-master-password failed.
    asadmin>
    Command multimode failed.
    glassfish@ahost:/opt/glassfish3/glassfish/domains/mydom01/config> which java
    /usr/bin/java
    glassfish@ahost:/opt/glassfish3/glassfish/domains/mydom01/config>
    All of glassfish is running fine apart from this.
    keytool could be found in /usr/java/latest/bin/keytool.
    Do we need to have this in the path? There is no requirement in the
    install guide for this, nor did the RPM installation adjust the system
    path accordingly.
    Hopefully someone can tell my how things ought to be regarding keytool?
    Thanks, Tom

    Hi Tom,
    the procedure to change the master password of glassfish server hosting APEX listener... sounds more like a GlassFish-related topic to me. I guess you'd get the best answers for such questions in a GlassFish-related forum...
    For what it's worth, I'll try my best anyway:
    Cannot run program "keytool": java.io.IOException: error=2, No such file or directoryThis seems to be a pretty clear error message: keytool , which is probably used to manage the keys for GlassFish users, wasn't found. This means, you're either running on an OS that is not officially certified for GlassFish, or you GlassFish hasn't been configured properly.
    You ran
    glassfish@ahost:/opt/glassfish3/glassfish/domains/mydom01/config> which java
    /usr/bin/java... which indicates you assume your GlassFish is running without JAVA_HOME being set. If that's true, I'd begin to setup you GlassFish properly starting with that parameter.
    Anyway, you also found out that
    keytool could be found in /usr/java/latest/bin/keytool.... which is not +/usr/bin+ and hence probably not in the global search path of the user on whose behalf your GlassFish is running. So, you could either create a link-set[*] for +/usr/bin/keytool+ to (finally) point to +/usr/java/latest/bin/keytool+, or you setup JAVA_HOME to be +/usr/java/latest+ .
    [*] Note that depending on your OS there might be more than one stage of indirection, e.g. my Ubuntu has +/usr/bin/java+ pointing to +/etc/alternatives/java+ which is pointing to +/usr/lib/jvm/java-6-sun/jre/bin/java+ where +/usr/lib/jvm/java-6-sun/+ is pointing to the directory containing the actual JDK to be used. You'll probably find something like that on your system as well. My Ubuntu box has a link for +/usr/bin/keytool+, so I get that when running "which keytool".
    Do we need to have this in the path? There is no requirement in the install guide for this, nor did the RPM installation adjust the system path accordingly.Again, this is not a GlassFish forum.
    I hope my hints help you solve your problem. If they don't, please choose the appropriate forum for your next post on that topic. And I guess, giving some more information on your OS and how you manage your JDK (and which version you use) will help people there to help you.
    Thanks,
    Udo

  • Can i create an exetutable (.exe) program with java???????

    I would like to learn how i can create an exetutable (.exe) program with java.
    Is there any additional package which i should download or buy it?
    Also i would like to write files into CD's direct from my application.
    Is there any library which i must download or buy?
    Thanks!

    check out the free open source GNU gcj native compiler for Java to see if it will do what you want.
    http://gcc.gnu.org/java/
    for writing data files you could use java.io.BufferedWriter. For sound files, look in the javax.sound package

  • Never programmed with Java

    Hello
    I have never programmed with Java, and dont know, what i can do, I use PHP, but, i am only a novice at it.
    I was wondering, is it possable to get data from a page, and put it into an image? if there is no data from the page, it will ask for the data to be added, and this will update every so often?
    Also, Most of you know about google maps, where you can search for something, well, can i do this same thing in java, have a map, not of the earth, but for a game, and make it easy to add different parts, so that we can search for it, and people can find it easy to look for what they are looking for?

    I think Google Maps is programmed in JavaScript using AJAX (short for Asynchronous JavaScript and XML) and is what as known as a web application. Google has released an API (still in beta) for working with Google Maps. The webpage for this API is http://www.google.com/apis/maps/. More about the development facilities Google provides can be found at http://code.google.com/.
    I've never read the source code to Google Maps before (a lot of which is available by just viewing the source code of the Google Maps webpage, which can be done by clicking, View > Source in Internet Explorer and View > Page Source in Mozilla Firefox), however I don't think it is a terribly complex application (this does not mean, however, that the source code is easy to read). I think the way it works is by requesting individual images as needed from the Google server and piecing them together on the client side (i.e. in the browser). Basically what you would need to do to use their existing code is to replace all requests made to the Google server with requests to a server of your own and have the server return the corresponding images. This might not be particularly easy to do.
    In my opinion, a better approach is just to write your own custom application (probably in Java) which simply mimics the behavior of Google maps, except with your own custom images. This way, you don't have to reverse engineer an entire web application before beginning to write one.
    Writing your own application for this purpose is not as difficult as it sounds, especially not in Java. Once understanding the basics, you will not be too far off from being able to write your application.
    Let's start with the most basic program (this program would be located in a file called Program.java):
    public class Program {
       public static void main(String[] args) {
    }This program simply starts, does nothing, and exits. I will explain this piece of code line by line, but first, I would like to gauge how much you already know to figure out how best to explain this. Have you used classes in PHP before?

  • Ios 7.0.2 issue: how to stop running programs

    I am a new iPhone5 user and just installed ios 7.0.2 (maybe I should not have but I did). Now I don't know how to stop running programs. Previously
    I double-clicked the Home button, then saw the icons that represented running programs, then could lightly touch one of them which led to all of them
    showing a X for a potential delete. That does not work now so how do I do it?

    Double click the home button and then swipe up on the app screenshots.

  • OSX 10.4.10, Net beans and Sams Programing with JAVA

    I am brand new to Java so I downloaded Net Beans on my MAC. I bought a copy of Teach Your Self Programing with Java in 24 hrs.
    So far I got the first three programs to compile on Net Beans but got stuck when they started to talk about arguments. The following will not compile. Starting at line 2
    1) System.out.println("The " + arguments [0]
    2) + " " + arguments[1] + " fox "
    3) + "jumped over the "
    4) + arguments[2] + " dog. ")
    I get the little red x on each line.
    Is the book wrong or am I missing something?
    All the tutorials talk about Javac. I can't seem to find it or get to it on my computer. How do I know if I even have it?
    And is there such a thing as a "command line" on a MAC?

    Hi, you should put any code you post in between code brackets like this:
      code here   I dont use a mac or netbeans but javac is the java compiler, you would not have been able to compile the first two. The .exe (or whatever mac executable is) is usually located in the lib folder in the java directory. It comes when you download JDK. As for the code, it would help me if you posted the first couple lines of the error message. It looks fine to me, but I would need to see your whole class in order to help you further
    and yes there is a command line on a mac...i think its called terminal and usually looks like a little computer
    Edited by: jaredL on Sep 20, 2007 7:45 PM
    Edited by: jaredL on Sep 20, 2007 7:47 PM

  • Running Programs with Screen Closed

    I cant figure out how to run programs with my screen closed. For instance, I'm signed on AIM and I close the screen and when I open it back up, I'm no longer signed on AIM. It's very frustrating. Any type of assistance would be greatly appreciated. Also, is there any phone number available that will connect me directly with customer service?

    Unfortunately, unlike PC counterparts, your laptop has 1 function with the laptop on, and screen closed - Sleep.
    Sleep can be reversed with closing the lid as described above, having an EXTERNAL mouse and or keyboard and activating the computer that way.
    It is really designed to run closed when use with a large display - that is what that feature is.
    Unfortunately you either have to keep your lid open, or accept the fact that you won't be on AIM when you close the lid.
    Now please don't get offended with the last part I have to say about AIM:
    I used to hate the fact that when I closed the lid, I was kicked off AIM. I now love it. The reality is that none of us are really all THAT important that signing out of AIM is the end of the world. There's email, and there's the telephone if someone has something emergent, urgent, important, or barely important to tell someone.
    I feel like AIM has dumbed down communication as we know it, creating a world of "acquaintances" and "buddies" instead of "friends".
    Like I said, please take no offense, i just think we all deserve time away from AIM...
    Sorry there aren't any other solutions for you.

  • How to run native program with Java program?

    Hello
    I've got following problem. I'd like to write file browser which would work for Linux and
    Windows. Most of this program would be independent of the system but running programs not. How to run Linux program from Java program (or applet) and how to do it in Windows?.
    Cheers

    Try this:
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec("ls -l");
    InputStream stream = proc.getInputStream();
    InputStreamReader isr = new InputStreamReader(stream);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    while ( (line = br.readLine()) != null) .....
    "if the program you launch produces output or expects input, ensure that you process the input and output streams" (http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html)

  • How to do a program with java user intarface (internet app) and c++ core

    I want to do a program to run on the internet with java
    but to run the mathematical core with c++ on a SUN machine.
    so, any help will be cool!, any tip about this subjet
    will be apreciate!
    my mail is [email protected]
    and [email protected]
    I am doing a Phd on electronics and i want to do
    a circuit simuilator online.
    thanks!

    One option is to use Java Native Interface (JNI).
    http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html

  • Writing Programs with java in 10.3.9

    So, I'm trying to teach myself the basics of Java. Here's what I did:
    I went to the apple website and poked around until I found what I THOUGHT was the right download. (JavaForMacOSX10.3Update5.pkg). This SEEMS to have created a Java folder (Applications/Utilities/Java) However I can't confirm that it wasn't there before I downloaded and ran the JavaForMacOSX10.3Update5.pkg. Inside this folder are four applications (Applet Launcher, Input Method HotKey and two other PlugIns).
    After reading a bunch of stuff about Java it seemed like I needed to be working with the Terminal Application in order to do command line stuff. I wrote a little program in TextEditor, saved it as "HelloApp.java" (like the book told me to) and then went to Terminal to try to compile it.
    When I open Terminal, here's what I see:
    Last login: Tue Jun 10 19:29:19 on ttyp1
    Welcome to Darwin!
    [Peter-Booths-Computer:~] peterboo%
    I typed in <javac HelloApp.java> and here's what I got back:
    error: cannot read: HelloApp.java
    1 error
    [Peter-Booths-Computer:~] peterboo%
    Sooo... my questions:
    How do I tell the computer through command line entries exactly WHERE my HelloApp.java file is? On a PC, they do something like cd C:/ to change directories to the location where the file is saved. Is there an equivalent command on a Mac?
    I'm not even sure that I've got the Java JDK or JSE or whatever the heck it's called on my computer. Can someone tell me how to figure that out?
    Is there a slicker way to compile, run etc. code with Java beside command line stuff in Terminal?
    Thanks a TON to anyone who can help me.
    Peter Booth
    Message was edited by: Peter Booth1

    Specify the path in the Terminal; a path will look like ~/Desktop/HelloApp.java if the item is on your desktop; when starting a path, ~ refers to your home folder, while / refers to the top level of the drive. Using 'cd' followed by a path will take you to that location from your current folder unless the path starts with a ~ or /, which work as above.
    A path which starts with ../ refers to the folder enclosing the one you're currently looking at.
    (32782)

  • Windows Programming with Java??? Is it possible???

    I have a small request from a client (Windows User) who wants a really simple POP3 email checker. I basically need to achieve the same thing that many email clients do, where they show some sort of symbol in the System tray when there is new email. I, however want to do this without the actual email client. All I want is the checker. This program will not download the email, gather information or anything. It will simply check the POP3 account and let the user know if there is new email.
    1.Can I get an icon to appear in the system tray and have a program that runs in the background, simply checking the POP3 account for new mail???
    2.If it is possible to interact with windows, then how is it done??? If this is too large of a question and you know of some resources that can answer this question for me, that will do.
    3.Is it even possible to have Java programs run in the background without appearing in the task bar??
    4. Am I trying to do something with Java that it just plain cannot do???

    Another really god option is to use the coroutine package from http://www.nevaobject.com/java/index.htm. This allows you invoke COM and Windows API's without having to write the JNI yourself. Its about $695 for a site-wide development license and has no binary distribution costs. A nice, cheap solution to spending lots of hours doing it youself. From the few things I tinkered with, it really does a great job too, but I have not deployed in a real production environment.
    Chuck

  • Is it possible to create java standalone programs with java ME 8

    Hi,
    Comparing java ME to java SE, I have the impression that midlets are similar to applets.
    When working with java SE, I usually make standalone programs.
    Now, I wonder if it is also possible to create also standalone programs for java ME, if the classes are only  using java ME API's.
    I already noticed that netbeans does not allow to build a project that does not contain a midlet, but maybe, it is possible to create a jar file
    using the javac and jar commands. Or is there a specific reason why netbeans does not allow to build a project without midlets?
    The reason for asking is, that I often make small tools in java that ae then called from a linux script. I imagine that this might be useful on the raspberry pi as well.
    Thanks in advance
    Jef

    Hi Jef -
    Comparing java ME to java SE, I have the impression that midlets are similar to applets.
    Sort of - similar life cycle methods - so conceptually, yes.
    Now, I wonder if it is also possible to create also standalone programs for java ME, if the classes are only  using java ME API's.
    In a way, yes. If you build an project, you will notice a JAD file and JAR file in the dist directory of the project.  JAD is the descriptor for a MIDlet - in mobile devices, the JAD
    file is loaded first to determine if the MIDlet has enough privileges to load and run, before the corresponding JAR file is downloaded.
    However, the JAD file can also be included in the Manifest of the JAR and the JAR copied to the embedded device manually and run there.
    I already noticed that netbeans does not allow to build a project that does not contain a midlet, but maybe, it is possible to create a jar file
    using the javac and jar commands. Or is there a specific reason why netbeans does not allow to build a project without midlets?
    You can build JAR files and include them into Java ME Embedded projects, but just like Applets, to use the Application Management System (AMS) on the Raspberry Pi, you must have a MIDlet to run.
    Perhaps you mean that you would like to launch the AMS and load a MIDlet from the command line on the Pi?
    If so, take a look at this section of the Getting Started Guide for the Raspberry Pi.
    Tom

Maybe you are looking for