Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4014826
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:32:39+00:00 2026-05-20T09:32:39+00:00

i have a problem with the .java.policy entries for my applet. I would try

  • 0

i have a problem with the .java.policy entries for my applet.

I would try to create folders and files with an applet. I had already signed my jar and added in the ${user.home}/.java.policy-file the following lines:

grant {
  permission java.io.FilePermission "<<ALL FILES>>", "read";
  permission java.io.FilePermission "<<ALL FILES>>", "write";
};

with this added lines, my applet works great, but this is not a good style, because every jar at any places becomes the file permissions too.

At the oracle pages are examples to set the codeBase to the specified applet.jar and set the signedBy (the alias wich the jar-file is signed) to grand permissions.

I have tried this many times, but it doesn’t work.

The code i have tried:

grant codeBase "http://www.wkmovies.de/appletDemo/-" {
  permission java.io.FilePermission "<<ALL FILES>>", "read";
  permission java.io.FilePermission "<<ALL FILES>>", "write";
};

or

grant signedBy "AKlettke" {
  permission java.io.FilePermission "<<ALL FILES>>", "read";
  permission java.io.FilePermission "<<ALL FILES>>", "write";
};

I have uploaded this example to: http://www.wkmovies.de/appletDemo/index.html

How can i set up the policy file, that my applet will work?


Here my code snips:
HTML:

<a href="javascript:document.applet1.createFolder();">
  Create Folder at C:\\Temp
</a>
<applet name="applet1" id="applet1" width="0" height="0" alt=""
  archive="applets/Demo.jar,applets/lib/commons-lang-2.4.jar" 
  code="demo.FolderCreator.class">
</applet>

FolderCreator class:

try {
  File f = new File("C:\\temp");
  f.mkdir();
  JOptionPane.showMessageDialog(null, "folder created",
    "successfull", JOptionPane.INFORMATION_MESSAGE);
} catch (Exception e) {
  e.printStackTrace();
  JOptionPane.showMessageDialog(null, e.getMessage(),
    e.getClass().getName(), JOptionPane.ERROR_MESSAGE);
}

(JDK1.6.0_23, Firefox 3.0.19, WinXP 32bit)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:32:40+00:00Added an answer on May 20, 2026 at 9:32 am

    Try priveleged API:
    http://download.oracle.com/javase/1.4.2/docs/guide/security/doprivileged.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem using the Java search function in Eclipse on a particular
I have a little Java problem I want to translate to Python. Therefor I
I have the following problem in my Data Structures and Problem Solving using Java
I am making an application with Java Swing and i have a problem. I
I'm having a small problem in Java. I have an interface called Modifiable. Objects
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem in some JavaScript that I am writing where the Switch statement
I have problem with return statment >.< I want to store all magazine names
I have problem with starting processes in impersonated context in ASP.NET 2.0. I am
I have problem with ActionLink. I'd like to pass to my ActionLink parameter for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.