Answer the question
In order to leave comments, you need to log in
Why does it always give an error when compiling a java application?
This is the output when compiling on the command line:
Hello.java:1: error: error while writing Hello: Hello.class
public class Hello {
^
1 error
Here is the program code itself:
public class Hello {
public static void main(String[] args) {
System.out.println("HelloWorld!");
}
}
It seems like everything is simple. On the Internet they write that most likely there is no access due to win7. But even if so, how to open access and why?
Answer the question
In order to leave comments, you need to log in
I'm not an expert, but maybe there is an "invisible character", the same BOM mark, try resaving the file in utf8-8 without BOM
Google did not look? Searching through the text of your error suggests that you probably saved the .java file in the Program Files folder (for example, in C:\Program Fiels\Java\jdk1.7.0\bin), in which Windows by default prohibits creation and modification files
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question