• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Running C++ exe files

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic