'IDEA run a sampe code and get the issue: java: illegal character:'#'
IDEA version: 2021.3.2
JAVA version: 1.8.0
The encoding format is UTF-8
I am a beginner in java, I try to install IEDA and run a sample code to output "HelloWorld", then get the error java: illegal character:'#' and other errors
What I tried:
Check the env path, right.
Create a
txtfile-> enter test code-> change the file type to.java, then run the cmdjavac test.javaandjava xxx, it outputHelloWorldChange the encoding format to GBK and then back to UTF-8
Add
-encoding UTF8in IDEA settings
update1
public class test{
public static void main(String[] args) {
System.out.println("Just a test");
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


