473,513 Members | 2,441 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Runtime.getRuntime.exec question

uni
I have the following

Process o = Runtime.getRuntime.exec("java stuff",en);
where en is -f CH-ResultsDB.. picked that up somewhere,
anyways
this code is run in a thread and i would like it to run every hour or so.
The program that is called is a popupwindow which asks for some information
from the user which then is send on to a server.
But the problem is when i run the program by itself so not via the runtime
command it works fine, but when i run it with a thread it sleeps before a
user has time to fill out the form and therefore crashes, i dont get a error
messgae but it doesnt seem to respond anymore...

Any ideas?

Erik
Jul 17 '05 #1
4 3547
uni
edit: The program doesnt crash however the window that is called up( the
form) doesnt respond anymore after i try to send the information. The thread
runs like normal
And when i run the program alone it works fine.
Jul 17 '05 #2
uni
found out some more.... the program which is called crashes when i try
establish the socketconnection. again when i run it by itself it works
fine... is there a way so that i can have two extends at the end, the reason
why i have two programs at the moment is becuase one is extends JFrame and
the other extends Thread...
Might it have to do with the fact that the thread is alredy asleep? if yes
how might i prevent for the first program to continue until the called
program is done?

Erik
Jul 17 '05 #3
not sure I understand all the details
of your question (might help if you
post some snippets of your code) but
just in case your problem turns on
this point I am wondering if you would
want to try defining one class to
extend JFrame and implement Runnable,
rather than having two classes extending
JFrame and Thread?

"uni" <s0******@sms.ed.ac.uk> wrote in message news:<c1**********@scotsman.ed.ac.uk>...
is there a way so that i can have two extends at the end, the reason
why i have two programs at the moment is becuase one is extends JFrame and
the other extends Thread...

Jul 17 '05 #4
He could just use "extends JFrame implements Runnable", then pass the object
to a "new Thread(Runnable)" (Sorry, original post is gone)

Jeff

"Joseph" <IL*****@unchance.net> wrote in message
news:64**************************@posting.google.c om...
not sure I understand all the details
of your question (might help if you
post some snippets of your code) but
just in case your problem turns on
this point I am wondering if you would
want to try defining one class to
extend JFrame and implement Runnable,
rather than having two classes extending
JFrame and Thread?

"uni" <s0******@sms.ed.ac.uk> wrote in message

news:<c1**********@scotsman.ed.ac.uk>...
is there a way so that i can have two extends at the end, the reason
why i have two programs at the moment is becuase one is extends JFrame and the other extends Thread...

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
9013
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...
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...
1
2272
by: C. Allen Sher | last post by:
Has anyone ran the Unix "newgrp" command from a java Runtime object? I can't seem to get it to work the way it should.
5
40441
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...
5
14387
by: Ayesha Ahsan | last post by:
Hi, I use Runtime.getRuntime().exec(command) to make my system call. For Windows based Dos, i add "cmd /c" before I type in my system call. So for example make the system call "dir": String...
2
11063
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...
5
25212
by: chenthil | last post by:
In my Java program I need to call two DOS batch programs namely call.bat and start.bat. First I need to start the batch program call.bat and once that program is completed, I need to call the other...
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
7259
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7380
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7523
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...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
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
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1592
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 ...
0
455
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.