Install JDK under Mac, and write Hello World

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.