Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

JRE access control

Thread view: 
n.torrey.pines@gmail.com - 07 May 2007 18:20 GMT
I'd like to run java *.class files with restricted access (no network,
read anything, but write only in the current directory). `java -h`
does not appear to mention any relevant access restriction options, so
how can this be done (simply, and without having to take a Java
course)?

(I am not a Java programmer, so perhaps I shouldn't post in this
forum, but the other groups in comp.lang.java.* appear to be dead)
Tom Hawtin - 07 May 2007 18:45 GMT
> I'd like to run java *.class files with restricted access (no network,
> read anything, but write only in the current directory). `java -h`
> does not appear to mention any relevant access restriction options, so
> how can this be done (simply, and without having to take a Java
> course)?

You need to run the java command with a security manager and policy set
on the command line. Something like:

  java -Djava.security.manager -Djava.security.policy=someURL SomeApp

You need to create a policy file with the permissions you want to give
the application.

Command line and policy syntax:

http://java.sun.com/javase/6/docs/technotes/guides/security/PolicyFiles.html

Details of permissions:

http://java.sun.com/javase/6/docs/technotes/guides/security/permissions.html

Obviously you don't want to give your application write permission on
your policy file.

Tom Hawtin


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.