# Solved: [VisualStudio 2010] - Redirecting input/output/error of java.



## FusionLord (Jan 25, 2009)

Hello all of my favorite people,

I am attempting to launch a java application in vb.net. works fine till I try to redirect input/output/error.

Here is what I have so far:


```
Dim myCon As New Process
        Dim si = myCon.StartInfo
        si.WorkingDirectory = Applicarion.StartupPath
        si.UseShellExecute = False
        si.RedirectStandardInput = True
        si.RedirectStandardOutput = True
        si.RedirectStandardError = True
        si.Arguments = "-jar " & Applicarion.StartupPath & "MYJAR.jar"
        si.FileName = "java"
        myCon.Start()
        readmycon(myCon.id)

  Public Function readmycon(pid)
          Do While Process.GetProcessById(pid).HasExited = False
               Debug.WriteLine(Process.GetProcessById(pid).StandardOutput.Read)
          Loop
          Return Nothing
End Function
```
As always all help is appreciated.

Thanks,
-FusionLord


----------



## FusionLord (Jan 25, 2009)

The java application launches if I don't have:

```
[FONT=monospace]
[/FONT] si.RedirectStandardInput = True
si.RedirectStandardOutput = True
si.RedirectStandardError = True[FONT=monospace]
[/FONT]
```
But when I attempt to redirect the Input/Output/Error streams
the only java opens and doesn't run my java application.

Thanks,
-FusionLord

P.S. Ent come to the rescue, Please!


----------



## Ent (Apr 11, 2009)

I'm afraid that I don't know how to do this, not being a Java programmer myself. I'll have a look into it, but I don't expect to come up with anything.


----------



## sepala (May 20, 2010)

I looked in to your code as you requested in here

There is no Java code I can find in your program, so, pardon me, Since this is VB or something, I can't help


----------



## Ent (Apr 11, 2009)

Sepala, the problem is trying to get a working interface between a java program and VB. I'm not sure which language the problem lies in though.


----------



## sepala (May 20, 2010)

Ent said:


> Sepala, the problem is trying to get a working interface between a java program and VB. I'm not sure which language the problem lies in though.


I am also confused in that case. Even I don't know what language the above is, (isnt it is prepCode)? However,

The working interface should be CORBA, if this is a distributed application. It is LANGUAGE INDEPENDANT system.

Anyway,



> the only java opens and doesn't run my java application.


what does this mean?


----------



## FusionLord (Jan 25, 2009)

A window with the java.exe path as the title shows up, and freezes at this point when I attempt to redirect the output/Input/Error, if I do not redirect the output/Input/Error the java application runs fine.


----------



## FusionLord (Jan 25, 2009)

*I Accidentally scrapped the program, lots of time lost.*


----------

