Recently I started learning Java, I encountered a problem when compiling code through a terminal (Mac OS X).
Program:

public class HelloWorld { public static void main(String args []) { System.out.println(«Hello World!») } } 

Moved to the terminal in the directory with the file cd desktop started compiling javac HelloWorld.java , the error message 61 appears: enter image description here What is my mistake and how to fix it?

Everything works through NetBeans, but as far as I understand, the very first method, without using additional software through the terminal, I want to learn it.

    1 answer 1

    Most likely you do not have the utf-8 encoding, however, the source code also has problems, firstly at the end of the line

     System.out.println(«Hello World!») 

    not enough semicolon ; and the quotes in which the string is enclosed also look strange: «» , they should be like this: "

    • Thank you very much, I'll fix it now and recheck. - Rumata
    • Thank you very much! Apparently it was in the encoding - I used Xcode and corrected errors - everything worked. - Rumata