Java Access被拒绝 [英] 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
以下是我的编辑从第27行到第39行的代码:
Here is the code from my editior from line 27 to 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*/
我在想我的问题可能与Win7教授有关:
(访问被拒绝)
I am thinking my problem might be related to Win7 Prof: (Access is denied)
我如何解决这个问题或我需要做什么或阅读以使其工作?
How do I resolve this or what do I need to be doing or reading to get this to work?
感谢您没有火红。
我刚刚更改了文件夹选项,以便我给定满(访问...),现在我只需弄清楚为什么我没有得到任何输出,当运行javac VendingMachine.java
我想一个新的问题是有序的。
I just changed the folder options such that I am the given full (Access...), now I just have to figure out why I am not getting any output, when running javac VendingMachine.java I guess a new question is in order.
推荐答案
您的工作目录是 C:\Program Files(x86)\ Java \ jdk1.6.0_17 \ bin
。您不能在此处写文件。将您的java文件复制到另一个目录并尝试在那里编译。
Your working directory is C:\Program Files (x86)\Java\jdk1.6.0_17\bin
. You are not allowed to write files here. Copy your java files to a different directory and try to compile them there.
编辑:
你应该在你的 PATH中包含
环境变量。并将 C:\Program Files(x86)\ Java \ jdk1.6.0_17 \ bin
JAVA_PATH
设置为 C:\Program Files(x86)\ Java @ \\ _ddk1.6.0_17
。
You should include C:\Program Files (x86)\Java\jdk1.6.0_17\bin
to your PATH
environment variable. And set JAVA_PATH
to 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
。
After that, you can call javac
from where ever you like.
这篇关于Java Access被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!