1, check whether the Mac system comes with Java environment, open terminal, input java-version, no information output;
2, in the Java official website choose Java8 Formac Download can
Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
3, install the JDK, because the MAC system will automatically configure environment variables, relative to the win installation to Simple point, after the installation is complete, review the JDK version, java-version
" 1.8.0_181 " 1.8. 0_181-25.181-b13, Mixed mode)
4, Vim Helloworld.java input code after the Save:
Public class helloworld{ publicstaticvoid main (string[] args) { System.out.println ("Hello world!" );}}
5, the implementation of Javac Helloworld.java and Java HelloWorld, the terminal interface display Hello world!
The class name in Ps:java is best for first letter capitalization
Install JDK under Mac, and write Hello World