Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

keytool error: java.io.filenotfoundexception

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm trying to create a .keystroke file by issuing :

keytool -genkey -alias tomcat -keyalg RSA

however, after entering name, organization,... I get following error.

keytool error: java.io.filenotfoundexception: \\txl-esf-01\desktop$\.keystroke (Access is denied)

I started to get this error message after installing JDK 6 Update 10 and updating JAVA_HOME, JRE_HOME, CLASS_PATH variables.

How do I fix this error? How can keytool executable refer to (\\txl-esf-01)?

Thanks.

aysan
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Do you have write access to the directory where keytool attempts to create the file? Or maybe the file exists already, and your permissions are not sufficient to overwrite it?
 
ethem narman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I checked and It seems I do not have permission to write to that folder.
However, when I try to create it in a new folder like:
keytool -genkey -alias tomcat -keyalg RSA -keystore D:\mykeystore

it gives:
keytool error: java.lang.Exception: Keystore file exists, but is empty: D:\mykeystore

if I try to delete alias tomcat with:
keytool -delete -alias tomcat

result is:
keytool error: java.lang.Exception: Keystore file does not exist: \\txl-esf-01\desktop$\.keystore

why I can not create the file in another folder?
thanks.
 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
maybe the error message tells the whole story. Does D:\mykeystore exist, and is it empty? Delete the file and run the command again.
 
ethem narman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just created the mykeystore folder. Folder is empty. I can not delete .keystore file since I do not have access to \\txl-esf-01\desktop$\ folder.
I am getting the same error (FileNotFoundException for .keystore) for each web application I'm creating.
what can I do then?
 
greg stark
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I just created the mykeystore folder



OK, that is your mistake. The keystore specified in the -keystore option is a file, not a directory. Delete the directory. Just let keytool create the keystore file for you.
 
ethem narman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I know that it is a file, not a directory. My aim was creating it (.keystore file) in D:\mykeystore folder.

Anyway, my problem is solved. I informed IT Department and they recreated my windows userprofile. Now it is working properly.
Thanks.

aysan
 
reply
    Bookmark Topic Watch Topic
  • New Topic