Writing Java code on Java mac

Source: Internet
Author: User

Look at the video to learn Java, do not want to download notepad++ and so on, although know that the Mac has embedded Java SDK, but still do not know how to write, today finally wrote my first Java program, or to the Hello world start

1, open the terminal, java-version see if there is a Java SDK

2, create a Java folder on the desktop (not required), in the folder to create the Hello World folder (easy to manage, not create can also, is a bit messy)

3, go to Hello World folder directory, terminal create Java file: Touch Helloworld.java

4, open Helloworld.java file and you can start writing a

public class HelloWorld {public  static void Main (String args[]) {    System.out.println ("Hello World");        }      }

5, start compiling, terminal input: Javac Helloworld.java

6, start running, terminal input: Java HelloWorld

7, the terminal can see the output: HelloWorld



Writing Java code on Java mac

Related Article

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.