Runtime.exec()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • madhawa84
    New Member
    • May 2007
    • 9

    #1

    Runtime.exec()

    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.
    Last edited by madhawa84; Jul 20 '07, 05:30 AM. Reason: spelling errors
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    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 ?

    Comment

    • madhawa84
      New Member
      • May 2007
      • 9

      #3
      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?

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        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.

        Comment

        • madhawa84
          New Member
          • May 2007
          • 9

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

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            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.wh en 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.

            Comment

            Working...