• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Security Manager

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
There is no "i" in denial. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic