For example if my java program write "hello world" to stdout then how would I get it to read that in and echo it to stderr?
I am pipelining the two,
The jar would contain essentially:
System.out.prin tln("hello world");
I am very confused as to how the two programs would intercommunicat e on teh pipeline, any help is helpful!
Doug
User Profile
Collapse
-
Reading from Stdin and echo to Stderr
I have a java program that writes to Stdout. I have to write a C program that reads from Stdin and echoes to Stderr. I have never dealed with C before so i was wondering if someone could help me out???
Thank you!
Doug -
Runtime.getRunt im().exec("ente r command here);
Is there a way to have this command executed in the same process that I have running where i execute the jar file that this java application would be in?Leave a comment:
-
My program is used in a custom console. I have a UI that has certain buttons, and based off of those buttons I need to execute certain commands in the shell. If I can get a simple command to execute outside of the custom console with a basic java app, then executing any command inside the custom console should be easy.Leave a comment:
-
for example if you open command prompt and you type "cd .." it performs change directory, or if you type "dir" it shows what in the current directory. I am working with a custom console, but I essentially want to be able to pass the same type of commands once a certain button is pushed.
I'm sorry this isn't very clear, I'm just a student and am at a summer job working on this project.
Dou...Leave a comment:
-
BIGDaddy
Thank you! Piping the programs is a great idea, and seems to be a quite simple solution to my problem. Do you know how to actually pass a command in java though? I dont want to just write to the console, I want to actually have a command passed.
Thanks for all the help!
DougLeave a comment:
-
I understand how to write GUI's and use actionlisteners ......The one thing I know how to code the java program to write in a command in C. Is there a way to actually have the command passed as
C:\ year 2008
or something very similar.
Its my last week at work and I just really want to get this working, thank you so much for all the help!
DougLeave a comment:
-
Its for a program that was already written, and instead of having to type in the command "play" or "pause", they want me to have a GUI that if you press the play button it will have command passed.....Leave a comment:
-
I guess to hopefully clarify......If button1 is pressed i want to type in "year 2008" and hit return so that the program takes that as a command. Hope this clears it up.
dougLeave a comment:
-
Java GUI and typing console commands
I have sucessfully launched a jar file from a C program, but now i need to figure out how to actually type commands into that console. I tried using the robot class, but when the GUI window is up it will not type into the console window.......
Any help would be greatly appreciated, thank you!
-Doug -
It writes to the console! This is the only thing left, if my boss has created a custom console with custom commands, how can i add a command that will launch this jar file, and if it does launch will it still write to the console?
Thanks guysLeave a comment:
-
thank you for all of the help! If i have the .jar write to system will it write in the active console of the C program?
Thanks in advance,
dougLeave a comment:
-
launching JAR file using C
I was wondering how you could create a console that would launch a JAR file. I have to do this for my summer job and I don't know much C at all.....thanks!
No activity results to display
Show More
Leave a comment: