Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5949477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:15:20+00:00 2026-05-22T17:15:20+00:00

I am trying to have Java execute another program, and it kept immediately erroring

  • 0

I am trying to have Java execute another program, and it kept immediately erroring out with exit code 128 and nothing sent to stdout or stderr. I tried a simple “java -version” still with no luck. When I run it in a cmd window, it runs fine and this code works on similarly configured other machines (Windows Server 2003 x64, Java 1.6 update 25)

When run on command line:

C:\Documents and Settings\zugwalt>java -version

Output:

java version "1.6.0_25" Java(TM) SE
Runtime Environment (build1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)

Then I try this code:

try {
            List<String> cmd = new LinkedList<String>();
            cmd.add("java");
            cmd.add("-version");
            ProcessBuilder apb = new ProcessBuilder(cmd);
            apb.redirectErrorStream(true);
            System.out.println("STARTING w00t!");
            Process p = apb.start();

            BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
            String line = null; 
            while ((line = input.readLine()) != null) {
                    System.out.println("OUTPUT: "+line);
            }
            System.out.println("EXIT: "+p.exitValue());
            System.out.println("WAIT FOR: "+p.waitFor());
        } catch (Exception ex) {
            System.out.println("CAUGHT: "+ex.getMessage());
            ex.printStackTrace();
        }

Output is:

STARTING w00t!  
EXIT: 128  
WAIT FOR: 128
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:15:21+00:00Added an answer on May 22, 2026 at 5:15 pm

    So we “solved” this by killing a large number of the system processes. We think the problem is closely related to the issues described here: http://www.arcanadev.com/support/kb/K00000329.aspx, with the process trying to call java’s exec being out of available heap space or memory. Very strange.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to execute a program from the Java code. Here is my
I am trying to mock java.awt.Toolkit.beep() using JMockit Expectations. I have the following code
I have to execute my program with this line: java -DImport=data.txt -Din=input.dat -Dout=output1.dat main.Main
I was trying to execute my java program through shell script so I wrote:
I'm trying to run ActiveMQ on Mac OSX 10.5.7. I have Java version 1.5.0_19
I have a Java project that I'm trying to implement with a model-view-controller design.
I have been trying to parse Java exceptions that appear in a log for
I have been trying to add to the Watch window a Java Date object
Lately I have been trying my hands on Eclipse IDE for java development. I
I have a legacy Java (not my native language) app that I'm trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.