Question:
Need HELP with JAVA, PLEASE!?
Hasan
2013-10-23 10:58:45 UTC
I write this on notepad and saved it with extention .java
CODE:

class biooo
{
public static void main(String args[])
{
System.out.println("Name: xyz");
}
}

-open my command prompt & change the directory & wrote "javac biooo.java"
and found this error:
"error while writing name: name.class (Access is denied)"
-I am constantly getting this error though there is no mistake in codes.
Pls help me out.
OS: Windows 8 (64bits)
Three answers:
Chris
2013-10-23 11:06:15 UTC
Not sure why javac tries to create name.class instead of biooo.class.



Never mind that, it sounds like javac doesn't have sufficient rights to create a file.

Either move the class to a place like c:\Java before trying to compile it or try opening an elevated command prompt. (right-click cmd and select "run as admin")
?
2013-10-23 12:00:31 UTC
Probably in a directory where you do not have write permission, but if so, how did you put .java file there?



Why is java trying to create name.class instead of biooo.class?



Also you want to use Public class.
Leo D
2013-10-23 11:10:12 UTC
It might be because your class is package accessible, try putting the keyword "public" before class. IMHO, I don't see any reason to create a lower than public accessible class outside of another class.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...