I'm having a big problem with my computer, as I try to compile source code made in Java language, hence a great frustration:
The variable of type String is poorly read and interpreted by the compiler and prints squares instead of special characters.
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Name:");
String name = sc.nextLine();
System.out.println(name);
}
}
Result:
My attempts were:
Change the "netbeans.conf" configuration file in the IDE's files folder located in File Explorer
Install multiple versions of NetBeans IDE to see if this problem occurs in all versions. Yes, it occurs in all versions and I have tried all the program's configuration alternatives
Uninstall and Install the version of the JDK on my computer and to ensure I also installed the JRE on my machine to see if the problem was resolved after installing all these programs. Nothing resolved and without success. The problem continued to compile this little code in the IDE.
With this problem, I can't:
- Create applications with databases (MySQL + JDBC) in the Java language, because the parameters of the PreparedStatement object do not recognize the special characters of the String due to this problem
Create Java applications in general, because if this problem occurs that, in my opinion, seems like an impossible solution to be solved on my computer, how will I continue to create systems with this special character recognition error?
Compile source code on my computer, as the compiler does not recognize special characters like ç, á, ã, â, í, among others and instead of displaying them in the output, squares appear as you saw in the previous image.
Was it some configuration that was left behind or is it a solution that I am not able to develop to fix this problem? And if so, what would be the best explanation for solving this problem? Will it be necessary to contact the technician for more information?