|
-
January 26th, 1999, 09:59 AM
#1
Java command line
Hi,
does Anyone know how to execute a command line command from within java code?
I am using windows N.T. and i would like to execute a command from a Java program.
Thanks.
charbel.
-
January 26th, 1999, 12:26 PM
#2
Re: Java command line
See the docs for the class Runtime. The exec() method is probably what you
are looking for
-
January 26th, 1999, 02:57 PM
#3
Re: Java command line
Hi,
Thanks for replaying to my message i have used the following :
String classPath = "d:\\javastar\\javastar.zip;f:\\bkw1\\lib\\rescue.zip;c:
\jdk1.1.6\\lib\\classes.zip;F:\\bkw1\\source\\classes;d:
\\jdk\\lib;d:\swingall\\swingall.jar ";
Runtime comp = Runtime.getRuntime();
comp.exec("javac -classpath "+classPath+" "+filename);
but it seems that nothing happens when i run the program!!!!!!!.
what i want is to have:
javac -classpath d:\\javastar\\javastar.zip;f:\\bkw1\\lib\\rescue.zip;c:
\\jdk1.1.6\\lib\\classes.zip;F:\\bkw1\\source\\classes;d:
\\jdk\\lib;d:\\swingall\\swingall.jar filename
executed at the command prompt.
thanks.
charbel
-
February 9th, 2001, 07:33 AM
#4
Re: Java command line
plese get the args values into the variables in your programe and display it back if more than one args loop it
vinay kumar s.v
-
February 12th, 2001, 03:24 PM
#5
Re: Java command line
Try the foll. if you are working in windows os.
comp.exec("cmd /c javac -classpath "+classPath+" "+filename");
-
February 12th, 2001, 11:38 PM
#6
Re: Java command line
but how to give the input from one process to another process started by a java program.
sanjubose
-
February 13th, 2001, 04:02 AM
#7
Re: Java command line
Hi,
Recently, I posted this:
http://codeguru.earthweb.com/bbs/wt/...a&Number=15098
You can easily couple an output stream of one process to an output stream of another process using the information in this post.
Regards,
Geert Arys
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|