Connecting Tech Pros Worldwide Forums | Help | Site Map

Runtime.exec()

Newbie
 
Join Date: May 2007
Posts: 9
#1: Jul 20 '07
i have written a simple java program using a Runtime.exec() .i was able to run my java program in the pc which i used to compiled the code.but when i migrate my program in to an another machine having the same OS(windows XP),my code did not worked .there was not any signs of execution of my code.why this was occured .explain me.

Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#2: Jul 20 '07

re: Runtime.exec()


Quote:

Originally Posted by madhawa84

i have written a simple java program using a Runtime.exec() .i was able to run my java program in the pc which i used to compiled the code.but when i migrate my program in to an another machine having the same OS(windows XP),my code did not worked .there was not any signs of execution of my code.why this was occured .explain me.

What did the program do ?
Newbie
 
Join Date: May 2007
Posts: 9
#3: Jul 23 '07

re: Runtime.exec()


my intention of above program was to pass some dos commands using Runtime.exec().but i was able to run the code in my pc .but i was unable to run that class in an another pc.why is that?
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#4: Jul 23 '07

re: Runtime.exec()


Quote:

Originally Posted by madhawa84

my intention of above program was to pass some dos commands using Runtime.exec().but i was able to run the code in my pc .but i was unable to run that class in an another pc.why is that?

What happened when you tried to run the program on that other machine. Are using a jar file? Also, are you able to run those DOS commands from the DOS shell on that machine.
Newbie
 
Join Date: May 2007
Posts: 9
#5: Jul 23 '07

re: Runtime.exec()


no i did not use any jar file,but instaed i copied the class file and tried to execute it via the "java "command.when i run the code nothing happened, at least no any sign of errors or whether the execution of the code or not.
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#6: Jul 23 '07

re: Runtime.exec()


Quote:

Originally Posted by madhawa84

no i did not use any jar file,but instaed i copied the class file and tried to execute it via the "java "command.when i run the code nothing happened, at least no any sign of errors or whether the execution of the code or not.

Which OS? Try putting println statements to see where the code hanging.
Reply