Java access denied

C:\Program Files (x86)\Java\jdk1.6.0_17\bin>javac VendingMachine.java
VendingMachine.java:27: error while writing VendingMachine: VendingMachine.class
 (Access is denied)
public class VendingMachine
       ^
1 error

Here is the code from my editor from lines 27 through 39:

public class VendingMachine /*This is line 27*/
{
   private int itemPrice;

   private int currentBalance;

   private int totalCollected;

   public VendingMachine(int itemCost)
   {
       itemPrice = itemCost;

   } /*line 39*/

I think my problem may be related to Win7 Prof: (Access denied)

How do I solve this, or what do I need to do or read to make it work?

Thank you for not burning.

I just changed the settings of the folder so that I was specified full (access ...), now I just need to find out why I am not getting any output when running javac VendingMachine.java I assume that the new question is in order.

+3
source share
3 answers

Your working directory C:\Program Files (x86)\Java\jdk1.6.0_17\bin. You are not allowed to write files here. Copy your java files to another directory and try compiling them.

change

C:\Program Files (x86)\Java\jdk1.6.0_17\bin PATH. JAVA_PATH C:\Program Files (x86)\Java\jdk1.6.0_17.

set JAVA_PATH="C:\Program Files (x86)\Java\jdk1.6.0_17"
set PATH=%PATH%;"C:\Program Files (x86)\Java\jdk1.6.0_17\bin"

javac .

+7

C:\Program Files (x86). .

+4

CMD , :)

-2

Source: https://habr.com/ru/post/1726231/


All Articles