Keytool usage with Runtime.getRuntime().exec() under Linux
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'd like to call the java keytool during runtime execution providing dynamic arguments. Here's what is working under Windows, but not under Linux (Ubuntu) same Java 1.6.0: File f = new File ( "mykey.jks" ); StringBuilder command = new StringBuilder (); command . append ( System . getProperty ( "java.home" ) + System . getProperty ( "file.separator" ) + "bin" + System . getProperty ( "file.separator" ) + "keytool" ); command . append ( " -genkey" ); command . append ( " -dname \"cn=foo,ou=bar,o=company,c=CH\"" ); command . append (