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

Java Security Manager

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ranchers,
Does anyone out there know of a way to enforce the default java security policy without having to manually include it as a system property on the command line argument when starting an instance of the JVM?
I've been starting it like this:
java -Djava.security.manager TestClient
This works but what if someone started the TestClient without the -Djava.security.manager all bets are off!
What I want to do is enforce any code run on a particular system, irrespective of how the JVM was invoked, to use the default security manager. I can ensure that only one instance of the JRE is loaded on the system.
Is this doable?
Any assisatance greatly appreciated...
TIA,
Mario
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mario,
java.lang.System has a method 'setSecurityManager(SecurityManager)' that allows you to set the security manager from code. I think this should suit your needs.
Akanimo.
 
I knew that guy would be trouble! Thanks tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic