Results 1 to 3 of 3

Thread: Runtime.exec()

  1. #1
    hknyo is offline Member
    Join Date
    Jun 2008
    Rep Power

    Question Runtime.exec()

    Hi all,
    I am launching some external applications from java Runtime.exec(). It works fine when everything goes well(i.e the application path is correct, file to launch is ok. etc...) but I wonder is there any way to determine if the application is installed before I launch, since I believe Runtime.exec() does not provide much control after it is called. I just need to know how I can determine if the application exists(installed) before I launch from java . It doesn't have to be using java Runtime but any method would be fine. here is my general scenerio

    1. 1 of 2 applications to lunch
    2. I can assume that the user will have at least one of them installed
    3. depending on what is installed, I willl launch using it
    4. if both of them are installed, I will give the user to select one of them.

    Thanks in advance

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power


    I assume that the applications are files located somewhere on the OS's path (the PATH environ var in windows, I don't know about other OS). If you can get the value of PATH, then you could look on all the paths for the file that starts the application.

  3. #3
    mrcheeks is offline Member
    Join Date
    Jan 2008
    Rep Power


    You can use the file methods
    if(new File(myapplicationFullPath).exists()){

Similar Threads

  1. Problem with Runtime.exec()
    By nhabibi in forum Advanced Java
    Replies: 11
    Last Post: 07-02-2008, 01:35 AM
  2. Runtime.exec(), handling input and output streams
    By crookshank in forum New To Java
    Replies: 0
    Last Post: 06-05-2008, 02:41 PM
  3. Exec cmd from Java application
    By javaplus in forum New To Java
    Replies: 0
    Last Post: 12-17-2007, 08:41 AM
  4. Nuxeo Runtime 1.2
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 06-22-2007, 06:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts