waitFor() never returns after creation of a process with Runtime.exec

Posted on 2003-12-04
Last Modified: 2008-03-17
when I create a process with Runtime.exec, waitFor() never

im trying to use cvs to check out a project. im calling the process from java. app is running on Unix - Solaris. if one file is specified for check out - it's fine
if whole project is not
code :
p =
Runtime.getRuntime().exec("cvs checkout FipWAR")

try {
if (isOSWindows() == false)
p.waitFor();//hangs over here - never returns
} catch (InterruptedException e) {

thank you

Question by:gmeltsin
LVL 15

Expert Comment

ID: 9878360

You may try it this way:

        fname = "cvs checkout FipWAR";
        boolean isOsWindows = Env.isOsWindows();

           if (!isOsWindows)
                Process t = Runtime.getRuntime().exec(fname)
        catch(Exception e){
            System.out.println("Error: " +e);
            return "Error";

Best regards, Raisor
LVL 15

Accepted Solution

jimmack earned 500 total points
ID: 9879248
Just in case it's of any use, here's an article on some of the problems that you get with the exec():

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
countX 22 82
autoit - check if option is checked in another program 2 108
Rubik's Cube Code for Effective Presentation 3 40
Base1 Encode/Decode 3 67
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now