473,504 Members | 13,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Runtime.exec()

9 New Member
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.
Jul 20 '07 #1
5 2598
r035198x
13,262 MVP
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 ?
Jul 20 '07 #2
madhawa84
9 New Member
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?
Jul 23 '07 #3
r035198x
13,262 MVP
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.
Jul 23 '07 #4
madhawa84
9 New Member
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.
Jul 23 '07 #5
r035198x
13,262 MVP
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.
Jul 23 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
9011
by: aa | last post by:
Anybody know the solution to trailing space in argument of Runtime.getRuntime().exec(arg), Process p = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler C:\\Documents and...
0
2132
by: Avnish Midha | last post by:
Does the Runtime.exec() method support parameters from non-native locales i.e. does it really support the entire unicode range of characters in the parameters. I am trying ot invoke a C++...
4
24492
by: Hal Vaughan | last post by:
I never noticed this before, but when I run an external program through Runtime, like this: Runtime rt = Runtime.getRuntime(); System.out.println("Running external command: " + sCommand); try...
1
5058
by: Hal Vaughan | last post by:
I've been using Runtime.exec() like this: Runtime rt = Runtime.getRuntime(); try {Process p = rt.exec("MyCommand.bat");} catch (Exception e) {do stuff} When I start my Java classes, I start...
0
1780
by: Anastasios Kotsikonas | last post by:
Hi all, here's the situtation: 1) JDK 1.4.2_02 & Tomcat 4.1.x (no difference with any 1.4.x) 2) Multiple threads (testing with 5) access non-sync methods in a single instance of a class...
5
40440
by: JW | last post by:
Hi, I don't seem to get any results from the following use of Runtime.getRuntime().exec(cmd) using Java 1.4 on Redhat linux. Suppose that in the same directory as my java file below, I have...
2
11062
by: uwnewsgroup | last post by:
When I was using Runtime.exec(String cmd) to run a unix utility (join), and try to get its standard output by using Process.getOutputStream(), it blocks forever. I tried it using Java 1.4 and...
2
2944
by: James Goldwater | last post by:
I have a situation where I actually _do_ want the command window to show after a runtime.exec() call. (Although we pipe stout/stdin to our own logging mech, the program needs to be able to trap...
2
3354
by: jerry chapman | last post by:
I am trying to send a command to windows from my java program, and I get an error. The pertinent (?) part of my code follows: public boolean action(Event evt, Object arg) { if...
3
6965
by: Shayco | last post by:
hey, in my code i'm using Runtime.getRuntime().exec() in order to run a .bat file that calls another java program (they communicate with each other using RMI). when i call: Process process =...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.