Hello World! does not print well on screen

0

I'm having problems with the ¡Hola Mundo! program and I'm not finding the error. The code that I have is the following:

public class HolaMundo { // Clase principal                                                              
    public static void main(String[] args) { 
        System.out.print("¡Hola mundo!"); 
    }
}

When I compile it using the javac HolaMundo.java , it does not generate any errors. The issue is that when I run the program using java HolaMundo , on the terminal screen, instead of appearing ¡Hola mundo! , I see ¡Hola mundo! . Whatever I do, I always see that  that should not be there.

In case you have something to do, the path that I have is the following:

  

C: \ ProgramData \ Oracle \ Java \ javapath;% SystemRoot% \ system32;% SystemRoot%;% SystemRoot% \ System32 \ Wbem;% SYSTEMROOT% \ System32 \ WindowsPowerShell \ v1.0 \ C: \ Program   Files (x86) \ Java \ jdk1.8.0_131 \ bin; C: \ Program   Files \ Java \ jdk1.8.0_131 \ bin;

Can you help me solve it?

    
asked by Martin P 27.04.2017 в 01:58
source

1 answer

0

Save the file so that it is of type UTF-8 and not ANSI. For example if you use notepad, you have to change the form instead of ANSI to UTF-8, If you use sublime text, in File-> Save with Econding-> UTF-8, because sometimes the IDE does not save it as it should have happened to me and I had to delete it, then create a new file with the same code but save it in this way.

    
answered by 27.04.2017 в 03:21