• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running C++ exe files

 
sarin kane
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to run c++ exe files using the runtime environment. Its giving an error :
c:\windows\system32\ntvdm.exe
Error in setting up runtime environment
Plz help me if you can any 1.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you invoke the command?

BTW: It's maximum an intermediate question.
My question is: How do you know ntvdm.exe is build from c++, and why is this important?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, welcome to the ranch!

Can you post some code around the way you launch your programs? I guess System.runtime.exec( something )?

Do you know where that message comes from? Is it something in your C++ program?

See if ProcessBuilder gives you an easier way to configure and start your other programs.
 
sarin kane
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
See i have a c++ prog. exe that i want to run in java . The error message which i am getting has nothing to do with my c++ program.
the java prog i have written is:
try{
Runtime r = Runtime.getRuntime();
Process p = r.exec("Myprog.exe"); /*Myprog is exe of my c++ prog */
}catch(Exception e1) { System.out.println(e1); }

when i run this java prog im getting this error :
"Error in setting up environment for the application "
Please Help me !!!
 
sarin kane
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the code that i have written above is corect or not?
Plz help me its urgent !!
i have tried using :
String temp = "cmd /k java -cp \"A:\MyDirectory\"MyApplication";
Process proc = rt.exec(temp);
But it doesnt work !!!
Is it possible to do it using a BAT file

Plz reply !!!
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read this:

http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?

I would first try to use the whole path to ntvdm.exe.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually when I Google an error message I get right to some explanation. I get no hits at all on this: "Error in setting up environment for the application" It's not often I get no hits on Google. Is that it word for word??

Try the full path to your program. Your program will not inherit any environment variables, but you can use ProcessBuilder to set some up if you need.
[ June 15, 2006: Message edited by: Stan James ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic