Install java in jdk and run the compilation (excluding the syntax ).

Source: Internet
Author: User

Install java in jdk and run the compilation (excluding the syntax ).

I. Development Preparation

1. jdk installation (window)

(1) download the corresponding jdk from your computer and install it (it is recommended to install it in a directory without Chinese characters ). Website http://www.oracle.com/technetwork/cn/java/javase/downloads/jdk7-downloads-1880260.html

(2) to configure environment variables, we recommend that you create a java_home system variable to store the jdk path, and configure the path % java_home % \ bin; after path, although jdk can be used normally, other plug-ins that require jdk to run may not be able to read the path, such as maven.

(Jvm (java Virtual Machine), jre (java Runtime Environment (including jvm and supported by basic class libraries), jdk (including jre ))

II. The first java program (excluding java syntax)

1. Create a Hello. java file according to the syntax

Public class Hello {public static void main (String [] args) {System. out. print ("Hello World ");}}

2. run the cmd command to go to the absolute path of the java file through cmd. (Alternatively, right-click the java file path, press shift, and press ctrl to open cmd ), use the javac command to compile the java file (java programs are compiled first and then executed) and generate. class File

3. Execute the class file using the java command (the actually executed class file is the compiled class file)

(In addition to the above methods, you can also set and use tools for execution)

 

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.