|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Stream of a process does not seam to be correctly redirectedHi all,
this is my first time writing to this list, so I hope I'm targeting the correct audience. I've developed a Java application which uses the Java Debug Interface (comes in the tools.jar-file of each Java SDK lib folder). The application starts a Java virtual machine and executes the given java program. After some time I thought it might be very cool to have this application as a .NET assembly. I converted my jar-file (as well as the tools.jar) and most functionality worked really fine. Although ikvmc could not convert the whole tools.jar-file, it was enough for my program to run. But I ran into a problem with reading out the output stream of the virtual machine process (reading out a stream from a process created on my own is actually no problem in the converted exe). I've added a small program showing this problem. I've also added the test file I'm using. To execute the program in eclipse, you have to reference the tools.jar and also set the working directory of the program to be the folder where your binaries are located (the compiled test file must be located in the subdirectory "main"). When you run the program, you will get an output similiar to: --> JAVA_HOME = C:\Program Files\Java\jre6 --> someting was printed out streamReader done vmThread done After converting the jar file to a .NET exe file (and placing it into the same directory), I only got the output: --> JAVA_HOME = C:\.virtual-ikvm-home vmThread done This reveals two differences: 1. Somehow the functionality of how the value of JAVA_HOME is obtained is differently (this is no environment variable, actually. Because it's not my java code, I can't say how the value is obtained). In the test application, I override this value with the correct path to be sure that the .NET exe has set the correct path. 2. It seems that reading from the output stream of the virtual machine process is not possible. There is no line indicating that stream.available() returns true. This is actually the bigger problem. Well, I hope someone might know a solution for my problem(s)! I also hope that the sample program is simple enough to be understandable. Markus ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Ikvm-developers mailing list Ikvm-developers@... https://lists.sourceforge.net/lists/listinfo/ikvm-developers |
|
|
Re: Stream of a process does not seam to be correctlyredirectedHi Markus,
What do you want do with the Java Debug Interface? If you want
start an external process then it is simpler to use
java.lang.Process.
Because IKVM does not implement the Java Debug Intererface
that you can't debug a IKVM process currently with a Java IDE. It can be
possible that if you use tools.jar that you can debug an real Java process with
a IKVM application. This part of JDI is 100% pure Java.
I think the problem is that the external process was not
startet. That you can not receive a stream. You test application sould create a
file or equals that you see that it was running.
Volker
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Ikvm-developers mailing list Ikvm-developers@... https://lists.sourceforge.net/lists/listinfo/ikvm-developers |
|
|
|
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |