• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Security Manager  RSS feed

 
Eibhlin Reid
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing a search of the hard drive of a PC through Java and just realised recently that if I don't have admin rights on a PC and I run my program it crashes. Is there some way to get around this using the Security Manager or something else???

Thanks in advance!
 
M Beck
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how does it crash? do you run into some exception you could catch, for instance?
 
Eibhlin Reid
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It gives me NullPointerException, which I have now caught. I just don't really understand why it's giving me this exception and if theres another way around it, other than catching the exception?
 
M Beck
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, it depends on exactly what's giving you this NullPointerException, and on under what circumstances it happens. you'd have to post more details before i could really diagnose the problem.

but as a first rough guess, i suppose that when you're running as non-Administrator you don't have rights to access all the files and directories on the system, and the exception might arise because you're trying to read a file you're not allowed to read. if this is the case, there's nothing you can do except either handle the exception or always run as Administrator; i would then strongly recommend you handle the exception.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!