I have a java application named mmi.jar. There is an environment
variable, i.e. MYJAVA_HOME which is my java home path.
With Windows cmd, it can run using the following commnad line:
> %MYJAVA_HOME%\bin\java mmi.SetupCapture
Can I run this java application from VC++?
Pls help me. Thank you!
Oliver Wong - 31 Aug 2006 14:42 GMT
>I have a java application named mmi.jar. There is an environment
> variable, i.e. MYJAVA_HOME which is my java home path.
[quoted text clipped - 4 lines]
> Can I run this java application from VC++?
> Pls help me. Thank you!
Sounds like what you need to do is have your VC++ application execute
the above mentioned command line. The details of how to do this are specific
to VC++ and are off topic in a Java newsgroup.
- Oliver
Allen - 01 Sep 2006 01:33 GMT
I work it out.
First, get environment variable using getenv("MYJAVA_HOME").
Then invoke the java application with CreateProcess(NULL, lpszCmdLine,
...).
If want to redirect input, output and error streams, you can use
CreateProcess to
set these streams.