Access is denied while compiling Java on Windows

后端 未结 7 974
星月不相逢
星月不相逢 2020-12-18 00:30

I created two java files: Pizza.Java and PizzaOrder.Java.

I tried compiling my code using javac in the command prompt like this:

         


        
7条回答
  •  青春惊慌失措
    2020-12-18 00:54

    I know this has no relation with Java, but try it, it worked for me.
    I realized it while I was playing with windows explorer.

    1. Goto C:\Program Files\
    2. Right click java folder, click properties. Select the security tab.
    3. There, click on "Edit" button, which will pop up PERMISSIONS FOR JAVA window.
    4. Click on Add, which will pop up a new window. In that, in the "Enter object name" box, Enter your user account name, and click okay(if already exist, skip this step).
    5. Now in "PERMISSIONS OF JAVA" window, you will see several clickable options like CREATOR OWNER, SYSTEM, among them is your username. Click on it, and check mark the FULL CONTROL option in Permissions for sub window.
    6. Finally, Hit apply and okay.

    This should be it. You will now be able to compile as well as run your java programs right there in the bin, instead of doing other things.

提交回复
热议问题