Problem developing application which calls and displays result of executable


 
Thread Tools Search this Thread
Top Forums Programming Problem developing application which calls and displays result of executable
# 1  
Old 05-09-2011
Problem developing application which calls and displays result of executable

Hi All,

i am using ubuntu 10.04 LTS with C2D processor.

i want to develop a GUI application in Java using JSwing. This application will call executable present in the local hardisk of linux. The results of this exectuable (moses) must be displayed in TextArea of the application being built.

Code:
          String [] arg1={"echo",s, "|TMP=/tmp","/home/nakul/moses/mosesdecoder/trunk/moses-cmd/src/moses","-f /home/nakul/moses/mosesdecoder/trunk/scripts/training/moses-scripts/scripts-20110405-1055/training/corpus/tuning/mert/moses.ini","-v","2"};
 

         System.out.println(s);
         Process pro2=Runtime.getRuntime().exec(arg1);
         BufferedReader stdInput=new BufferedReader(new InputStreamReader(pro2.getInputStream()));
         //BufferedReader stdOut=new BufferedReader(new OutputStream(pro2.getOutputStream()));
       
        String s11="";
 

        while((s11=stdInput.readLine())!=null)
        {
            jTextArea1.append(s11);
        }
 

         }catch(Exception e){
 

             System.out.println(e);
         }
 

     }

i have tried running the above code but it displys the whole paramters of moses executbale in text area..

Please tell how to solve this problem...

Thanks in advance,
n929
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Create a shell script to gather user account information and displays the result to administrator

I want to create a shell script to gather user account information and displays the result to administrator. I have created a script but its showing all the information when i search for username like: amit@mx:~$ ./uinfo.sh amit Username : amit User Info ... (2 Replies)
Discussion started by: amit1986
2 Replies

2. Solaris

Find path of executable having problem

Hi cannot find the path to a running process on a host. I looked and tried some suggestions in forums to no avail. can someone please help? I need to know where this process is starting from as we have several versions in multiple directories --------- Process name 1201 1 0 Feb 14 ?... (14 Replies)
Discussion started by: mnassiri
14 Replies

3. UNIX for Advanced & Expert Users

problem with restarted I/O system calls

Greetings. Suppose I have a UNIX OS with automatic-restart (by default) of interrupted system calls, or I use sigaction() with SA_RESTART flag. If I am in the middle of a read(fd1, buf1, MAXSIZE) or a write(fd2, buf2, MAXSIZE), and I am interrupted by a signal, then the system will... (1 Reply)
Discussion started by: aigoia
1 Replies

4. UNIX for Dummies Questions & Answers

Problem running executable with ./

Hey all, I'm trying to execute a program and despite it appearing to be there, I keep getting this: -bash: ./aisdispatcher: No such file or directoryTo run it, I'm going into the directory where it is stored and running ./aisdispatcher...the result of which should just be a listing of options... (10 Replies)
Discussion started by: pmd006
10 Replies

5. AIX

Developing application software on the AIX

I am a programmer who works on an IBM i (including AS/400, iSeries, System i and Power). In developing application software on the IBMi we use languages such as RPG/ILE and CLLE. There is a need also to use PF, LF, DSPF & PRTF to represent the physical/logical database and screen/print objects.... (0 Replies)
Discussion started by: Elias
0 Replies

6. Shell Programming and Scripting

Problem while scp if bashrc calls Perl script

A weird thing, happened today: When i do SCP from a remote server, file is not getting copied to here. Application Server: Here is where i work, and have a login. I have several tweaks in .bashrc, and along with all those, today i called a PERL script from bashrc. So when ever i do scp from a... (4 Replies)
Discussion started by: thegeek
4 Replies

7. Shell Programming and Scripting

problem in making Awk executable script

Guys I placed #!path/awk -f placed awk script and used $1 to call 1st inputfile inside the script. But some where I did mistake. Could you please help me run this script as executable I forgot to mention I also used BEGIN before placing awk script. But nothing worked out. Script ... (2 Replies)
Discussion started by: repinementer
2 Replies

8. Shell Programming and Scripting

problem developing for or while loops with the cut command

I have been working on a script all day and am having very little success. Essentially, I am reading a file and trying to format the data in the file. I am currently trying to put the data into three separate files, so that I can paste them back together into a single output file. Trying to... (16 Replies)
Discussion started by: synergy_texas
16 Replies

9. Programming

problem in creating executable for a client program

Hi, I am trying to run simple client server c program in unix.At the compling stage server is creating an executable but the client is not. below is the link to the source codes: http://www.cs.rpi.edu/courses/sysprog/sockets/server.c http://www.cs.rpi.edu/courses/sysprog/sockets/client.c ... (2 Replies)
Discussion started by: konas
2 Replies

10. IP Networking

Identification of data calls & voice calls

Is there any facility to filter/identify the data calls and voice calls coming throug modem? OR Can we get the data or voice calls information through a script(preferably C Kermit)? (0 Replies)
Discussion started by: pcsaji
0 Replies
Login or Register to Ask a Question