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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:55:08+00:00 2026-06-03T15:55:08+00:00

I am trying to build a Java applet, called game , which is something

  • 0

I am trying to build a Java applet, called game, which is something I have never done before (I’ve always just built standalone applications). My applet works fine when I test it in Eclipse, but when I try putting it on my website, I get the following error in the console:

java.lang.reflect.InvocationTargetException
    at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(DeployAWTUtil.java:116)
    at sun.plugin2.applet.Plugin2Manager.runOnEDT(Plugin2Manager.java:3541)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3072)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1497)
    at java.lang.Thread.run(Thread.java:680)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
    at java.security.AccessController.checkPermission(AccessController.java:546)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
    at java.lang.System.getProperty(System.java:667)
    at java.io.UnixFileSystem.resolve(UnixFileSystem.java:118)
    at java.io.File.getAbsolutePath(File.java:501)
    at game.<init>(game.java:117)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at sun.plugin2.applet.Plugin2Manager$13.run(Plugin2Manager.java:3060)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682)
    at java.awt.EventQueue.access$000(EventQueue.java:85)
    at java.awt.EventQueue$1.run(EventQueue.java:643)
    at java.awt.EventQueue$1.run(EventQueue.java:641)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:652)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception: java.lang.reflect.InvocationTargetException

It says access denied (java.util.PropertyPermission user.dir read), but I can’t figure out where it’s trying to read something off the user’s file system.

It also says at game.<init>(game.java:117), but I went into my file and made a message output to the console on line 114 and it never got written. I then figured that maybe it was looking at line 117 inside public game(), so I looked for that and it was the start of a listener for a Mouse event. It made sense to me that this would be something that Java would need permission to read, so I deleted all of it and then deleted all the imports for good measure. Then I cleared both Chrome and Java’s caches and retried. Same error.

  1. What does this mean, am I interpreting it incorrectly?
  2. When it says that line 117, what is it line 117 of?
  3. Why would this be happening?
  4. How can I fix it?
  5. How can I prevent it in the future?

For reference, here is the code for public game():

public game() throws MalformedURLException{

    JPanel board = new chessboard();
    board.setSize(320, 320);
    board.setLocation(0, 0);

    System.out.println("Got this far");

    Piece wp1 = new Piece(wpawn, a2);
...
    Piece bk = new Piece(bking, e8);


    board.add(wp1);
...
    board.add(bk);

    wp1.setLocation(wp1.square.getPoint());
...     
    bk.setLocation(bk.square.getPoint());

    add(board);
    repaint();

    addMouseListener(new MouseAdapter(){
        public void mousePressed(MouseEvent evt){

            for (int i = 0; i < 8; i++){
                for (int j = 0; j < 8; j++){
                    if (squares[i][j].piece != null)
                        System.out.println(squares[i][j].getPointString() + ": " + squares[i][j].piece.type);
                }
            }

            Point p = evt.getPoint();
            if (0 < p.x && p.x < 319 && 0 < p.y && p.y < 319){
                Square clicked = getSquare(p);
                System.out.println("up: " + clicked.getPointString());
                if (clicked.piece != null){
                    pickedUp = true;
                    pickedUpPiece = clicked.piece;
                }
            }
        }
        public void mouseReleased(MouseEvent evt){
            if (pickedUp){
                Point p = evt.getPoint();
                if (0 < p.x && p.x < 319 && 0 < p.y && p.y < 319){
                    System.out.println("down: " + getSquare(p).getPointString());
                    movePiece(pickedUpPiece, getSquare(p).getColumn(), getSquare(p).getRow());
                }
                pickedUp = false;
            }
            else System.out.println("Not picked up");
        }
    });
}
  • 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-03T15:55:09+00:00Added an answer on June 3, 2026 at 3:55 pm

    The key output of the stack trace is:

    at java.io.File.getAbsolutePath(File.java:501)
    at game.<init>(game.java:117)
    

    This means that your game.java file, at line 117, is calling getAbsolutePath() on something. Java applets embedded in a browser are not permitted to access the local filesystem.

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

Sidebar

Related Questions

I am trying to build a java applet which downloads a file to the
I have been trying to build an online java compiler. But running the clients
I've never programmed in java or eclipse before, although I have used c# and
I'm trying to build my Flex/Java web app from within IntelliJ rather than have
I am trying to build a simple java program which creates a db file,
i'm trying to build a Java applet and i'm having a major problem trying
I am currently trying to build a Java Project with several dependencies. I have
Im trying to build a text classifier in JAVA with Weka. I have read
I'm trying to build a small Java app for connecting to an application called
I'm trying to get my java build to fail when I have a class

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.