Forum posts for java.exe

Process.StandardInput.WriteLine Not working on Java.exe

I'm having an issue with the following code:

private void Form1_Load(object sender, EventArgs e)
{
cmdOutput = new StringBuilder('');
cmdProcess = new Process();

cmdProcess.StartInfo.WorkingDirectory = @'C:android-sdk ools';
cmdProcess.StartInfo.FileName = @'java';
cmdProcess.StartInfo.Arguments = @'-Xmx512m -Djava.ext.dirs=lib;libx86_64 -Dcom.android.monkeyrunner.bindir=..framework -jar libmonkeyrunner.jar';

cmdProcess.StartInfo.UseShellExecute = false;
cmdProcess.StartInfo.CreateNoWindow = true;
cmdProcess.StartInfo.RedirectStandardOutput = true;
cmdProcess.OutputDataReceived += new DataReceivedEventHandler(SortOutputHandler);
cmdProcess.StartInfo.RedirectStandardInput = true;


cmdProcess.Start();

cmdStreamWriter = cmdProcess.StandardInput;
cmdProcess.BeginOutputReadLine();

// Even if i fire this later it doesn't work.
cmdStreamWriter.WriteLine(@'print 'Hello World'');
}


The issue is that:

cmdStreamWriter.WriteLine(@'print 'Hello World'');


Is not doing anything. Nothing is being written to the java process.

The output appears to be working fine (tested by loading a script directly to monkeyrunner.jar. But after trying many times I'm not getting any input.

This does work fine if I change the process to 'cmd'

View complete forum thread with replies

Other posts related to java.exe

See Related Forum Messages: Follow the Links Below to View Complete Thread

difference between bin's java.exe and jre's java.exe?
Server option for java.exe
Regarding killing a particular Java.exe
restart java.exe from an applet
Include java.exe in the runtime built
Silent mode execution with java.exe
Leakage of java.exe processes
killing process java.exe
Recompiling the java.exe laucher
Symbols not loaded for java.exe
tomcat or java.exe stops responding
Java.exe access is denied
Get path to java.exe [duplicate]
Process.StandardInput.WriteLine Not working on Java.exe
Is the java.exe program the actual VM? [duplicate]

What is the carbon footprint of your coffee?

Is it low? Is it high? Can this things really kill the planet Earth? Maybe the answer will surprise you. Maybe not.