The Artima Developer Community
Sponsored Link

Java Answers Forum
Exe file

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Imran Siddique

Posts: 2
Nickname: nightmare
Registered: Aug, 2002

Exe file Posted: Aug 22, 2002 5:48 AM
Reply to this message Reply
Advertisement
hey i need some help how i can call any exe file from my java program. below is code given.. i want when i wrote a string to file then i want run that exe file named as "starttag.exe" .. but i getting error..
some please help me
---imran---


import java.io.*;
import java.lang.*;
import javax.swing.JOptionPane;
import java.util.StringTokenizer;
import java.util.Vector;
import java.lang.Runtime;


class token
{
// start of main

public static void main (String [] args)
{
token t = new token();
t.readMyFile();
}
//end of main

// readMyFile



void readMyFile ()
{
String record = null, mrecord=null;
record = new String();
mrecord = new String();
String uinput=null;
Vector v = new Vector();
try
{

uinput = JOptionPane.showInputDialog("Enter a Sentance to translate");

BufferedWriter out = new BufferedWriter(new FileWriter("input.txt"));
out.write(uinput);
out.close();

Runtime rt = Runtime.getRuntime();
Process p = rt.exec("starttag.exe);

//
} rest of program is ok

Topic: Design and implement a class Previous Topic   Next Topic Topic: XML Reading...

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use