Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Cannot pass arguments to an exe file from Java

794113Feb 12 2012 — edited Feb 12 2012
Hi, I need to run an exe file from Java. The exe runs but I am not able to provide an essential parameter to the exe.

String[] cmd = { "Dir1/the-exe-file","-param1", "<", "text-file.txt"};
Process pr = rt.exec(cmd);

It takes the first argument with no problems. But cannot take the "<" argument. The exe gives error.
In windows command prompt I need to specify that angular bracket as the next parameter is
the input file to the exe.

Do I need to escape it? or what is a solution to this problem?

Thanks

Edited by: kooldba on Feb 12, 2012 2:25 PM

Edited by: kooldba on Feb 12, 2012 2:26 PM
This post has been answered by EJP on Feb 12 2012
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 11 2012
Added on Feb 12 2012
3 comments
380 views