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 8184589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:33:23+00:00 2026-06-07T01:33:23+00:00

First of all I’m aware that my question is same as in here .

  • 0

First of all I’m aware that my question is same as in here. But that question did not helped me.

I have self signed applet.

jarsigner -verify sJSApplet.jar
jar verified.

Warning:
This jar contains entries whose signer certificate will expire within six months.

Applet’s purpose is to open MS Word document from LAN machine.
So far I’ve tried opening using Desktop.open() and Runtime.exec(). With AccessController.doPrivileged and without. I always get java.security.AccessControlException: access denied.

I’m out of options. What else I could do?

I cannot use java.policy file.

HTML

<html>
    <head>
        <script>
            function openFile( command ) {
                    var applet = "<object type='application/x-java-applet' height='100' width='100' name='jsApplet'><param name='code' value='com.avacoda.swing.JSApplet'/><param name='archive' value='sJSApplet.jar' /><param name='mayscript' value='true'/><param name='filePath' value='C:\\note.txt'/>Applet failed to run.  No Java plug-in was found.</object>";

                    var body = document.getElementsByTagName("body")[0];
                    var div = document.createElement("div");
                    div.innerHTML = applet;
                    body.appendChild(div);
            }
        </script>
    </head>
    <body>
        <a href="#" onclick="openFile('C:/note.txt');">Open file</a>
    </body>
</html>

Java code:

public class WordApplet extends JApplet {

    @Override
    public void init() {
        openFile(getParameter("filePath"));
    };

    public void openFile(final String path) {
        AccessController.doPrivileged(new PrivilegedAction<Object>() {

            @Override
            public Object run() {
                try {
                        Runtime.getRuntime().exec("winword " + path); 
                        //Desktop.getDesktop().open(new File(path));
                } catch (Exception e) {
                    e.printStackTrace();
                }
                return null;
            }
        });
    }
}

Full stack trace

java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkExec(Unknown Source)
    at java.lang.ProcessBuilder.start(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at com.test.applet.JSApplet$1.run(JSApplet.java:34)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.avacoda.swing.JSApplet.openFile(JSApplet.java:29)
    at com.avacoda.swing.JSApplet.init(JSApplet.java:25)
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
basic: Applet initialized
  • 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-06-07T01:33:27+00:00Added an answer on June 7, 2026 at 1:33 am

    There is nothing wrong with code samples above. Both cases Desktop.getDesktop().open() and Runtime.getRuntime().exec() works perfectly.

    My problem was badly packaged jar.

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

Sidebar

Related Questions

First of all there is a question with the same title here on SO
First of all: I am not an experienced ClearCase user, but I have lots
First of all there is a partial question regarding this, but it is not
First of all there is probably a question like this already but i couldn't
First of all, apologize because I have seen some posts about this, but I
First of all, let me say that I am not a professional coder -
First of all, let me clarify that I know you cannot have actual abstract
First of all, I am aware that there is a similar topic regarding the
First of all, I know that this is because of bad libraries, but I
First of all I have seen that there are many questions about unrecognized selector

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.