开发者

How to make forward slashes be respected by java keytool in Cygwin environment?

开发者 https://www.devze.com 2023-03-03 02:20 出处:网络
I\'m running the Java keytool program with -v $HOME/.keystore, which works fine in Unix (creates $HOME/.keystore), but in Cygin gets confused - says it is storing

I'm running the Java keytool program with -v $HOME/.keystore, which works fine in Unix (creates $HOME/.keystore), but in Cygin gets confused - says it is storing

/home/myaccount/.keystore

but fails with FileNotFoundException trying to write

\home\myaccount.keystore

How can I force keytool to use forward slashes? 开发者_开发问答

----> Follow up: thanks to @mikerobi below who answered my question. A little code frag for bash to use this in would be:

keystore="$HOME/.keystore"
if [ `uname -o` == 'Cygwin' ]
then
    keystorefile=`cygpath -wp $keystore`
fi


Use the cygpath utility, which can convert any cygwin path to a windows path.

keytool -v `cygpath -w "$HOME/.keystore"`
0

精彩评论

暂无评论...
验证码 换一张
取 消