[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

start another program from an application

Posted on 2006-11-03
6
Medium Priority
?
230 Views
Last Modified: 2010-03-31
Hi Experts,


A simple question...

I have developed an application and from that application I have to start another application that is on my hard disk.
Is there a way to start that outside application from my application.



Thanks
0
Comment
Question by:blarouche
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 5

Assisted Solution

by:gkishoreji
gkishoreji earned 200 total points
ID: 17868632
u can use Runtime.exec to execute that application
0
 

Author Comment

by:blarouche
ID: 17868767
The file I have to start is in my F:\ua\EzDownloader.exe

How would I code that?


0
 
LVL 14

Accepted Solution

by:
hoomanv earned 300 total points
ID: 17868811
Runtime.getRuntime().exec("F:/ua/EzDownloader.exe");
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:blarouche
ID: 17868900

I get the following messasge when I run the code :

java.lang.IllegalThreadStateException: process has not exited
      at java.lang.ProcessImpl.exitValue(Native Method)
      at alarms.Test.main(Test.java:13)


I have to say that when I  excecute EzDownloader,  another message box appears and ask me to push on the button Download now.
0
 

Author Comment

by:blarouche
ID: 17868910
I forgot to include my code :

import java.util.*;
import java.io.*;


public class Test
{
    public static void main(String args[])
    {
        try
        {            
            Runtime rt = Runtime.getRuntime();
            Process proc = rt.exec("F:/ua/EzDownloader");
            int exitVal = proc.exitValue();
            System.out.println("Process exitValue: " + exitVal);
        } catch (Throwable t)
          {
            t.printStackTrace();
          }
    }
}
0
 
LVL 14

Assisted Solution

by:hoomanv
hoomanv earned 300 total points
ID: 17868939
exitValue() throws IllegalThreadStateException - if the subprocess represented by this Process object has not yet terminated.

You can use waitFor to wait for the process to terminate
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question