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

  • Home
  • SEARCH
  • 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 9074435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:38:07+00:00 2026-06-16T18:38:07+00:00

I thought this would be pretty straight-forward, but I’m having problems with the Process

  • 0

I thought this would be pretty straight-forward, but I’m having problems with the Process class and redirected stdout. I’m trying to run a java program (Craftbukkit, Minecraft server software) and redirect the output.

Everything works correctly for the first two lines

210 recipes
27 achievements

but after that line every line that follows is simply “>”

>
>
>
>
>

Correct output should look like this

210 recipes
27 achievements
20:52:45 [INFO] Starting minecraft server version 1.4.6
20:52:45 [INFO] Loading properties
20:52:45 [INFO] Default game type: SURVIVAL
20:52:45 [INFO] Generating keypair
20:52:46 [INFO] Starting Minecraft server on *:25565
20:52:48 [INFO] This server is running CraftBukkit version git-Bukkit-1.4.6-R0.3
-5-g82c58b5-b2589jnks (MC: 1.4.6) (Implementing API version 1.4.6-R0.4-SNAPSHOT)

20:52:49 [INFO] Preparing level "world"

I put in a breakpoint to see what the value of e.Data was, type string, value “>”. So the issue is not with outputting.

Code:

static void Main(string[] args)
{
    ServerProcess p = new ServerProcess("craftbukkit.jar");
}

class ServerProcess
{

    public ServerProcess(string server_jar)
    {
        ProcessStartInfo pInfo = new ProcessStartInfo("java", "-jar " + server_jar);
        pInfo.RedirectStandardOutput = true;
        pInfo.RedirectStandardError = true;
        pInfo.UseShellExecute = false;

        Process p = new Process();
        p.StartInfo = pInfo;
        p.OutputDataReceived += new DataReceivedEventHandler(ServerOutputDataReceived);
        p.ErrorDataReceived += new DataReceivedEventHandler(ServerErrorDataReceived);
        p.Start();

        p.BeginOutputReadLine();
        p.WaitForExit();
    }

    static void ServerErrorDataReceived(object sender, DataReceivedEventArgs e)
    {
        Console.WriteLine("Error: {0}", e.Data);
    }

    static void ServerOutputDataReceived(object sender, DataReceivedEventArgs e)
    {
        Console.WriteLine("{0}", e.Data);
    }

}

Does anybody know what is happening? Any help would be appreciated.

  • 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-06-16T18:38:08+00:00Added an answer on June 16, 2026 at 6:38 pm

    It happens very often that normal, non-error messages are handled like errors.
    You added the error handler, but didn’t started it.

    p.BeginErrorReadLine();
    

    EDIT:
    Also try WriteLine without formatting

    Console.WriteLine(e.Data);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Thought this would be pretty straight forward, but my value is remaining the same
I'm new to AutoFac, but I thought this would be pretty straight forward. I've
Okay at first I thought this would be pretty straightforward. But I can't think
I thought this would be pretty easy but I'm running into all sorts of
OK so I thought this would be pretty simple but it's tripping me up..
I thought this would be pretty simple, but it is proving a bit more
I thought this would be pretty simple to do but seems I must be
I have, what I thought was a pretty straight-forward query. In normal Sql this
I thought this would be pretty straightforward, but I've been searching for a way
I thought this would be fairly simple but it turns out not to work

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.