alapatimailbox sasibhushankumar.alapati at
Thu Jan 6 03:43:54 CET 2011

Hi All,

 MY OS is : Linux.

 I have written a Java Program to run a GPG  Command using Java's exec
command like:

  The command here is a gpg encryption command like :

gpg --recipient "alapati" --output "Encrypted/SampleEncrypted.gpg" --encrypt

   If i run this command from  terminal it is working fine .
   But if i run this command from java program it is giving the following
error.The java program is executed from root users context.I tried setting
the ring key as well but the same error was coming.

  Error is:
  [root at ESBING01 GnuPG]# java TestGPG "/oracleGL/GnuPG/gnupg-1.4.9/g10"
ENCRYPT COMMAND: gpg --keyring /root/.gnupg/pubring.gpg --recipient
"alapati" --output "Encrypted/SampleEncrypted.gpg" --yes --encrypt
gpg: "alapati": skipped: public key not found
gpg: "Sample.txt": encryption failed: public key not found

But if the same java program was ran from windows machine with the same
setup it works fine . Only in linux it is giving the following error.
Tried lot of options but nothing is working.Please help me.It is very urgent
for my project.
If you need any other info let me know,

View this message in context:
Sent from the GnuPG - User mailing list archive at

More information about the Gnupg-users mailing list