Skip to Main Content

Java Programming

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.

ProcessBuilder is not working in windows for run gpg command

3433345May 10 2017 — edited Jun 23 2017

Hi All,

I am using jdk 1.8 and I wrote code to run gpg command in ProcessBuilder  like below

ProcessBuilder pb = new ProcessBuilder("cmd","/C","gpg --batch --yes --cipher-algo 3DES -r ED873D23 --trust-model always --output (folder_path) --encrypt Input_File_path");

Process p=pb.start();

p.waitFor();

It is not creating encrypted file in given folder_path through above code but, in command prompt if I execute above command which I have given in parameter its creating encrypted file in given folder_path properly.

And I used Runtime.getRuntime().exec(" cmd.exe /C gpg --batch --yes --cipher-algo 3DES -r ED873D23 --trust-model always --output (folder_path) --encrypt Input_File_path"); It is also not workig

Please suggest

Thanks in advance.

Comments

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

Post Details

Locked on Jul 21 2017
Added on May 10 2017
2 comments
1,569 views