One of the Java Learning Essays: A Java language overview and development environment

Source: Internet
Author: User

Java SDK Download:

Http://www.oracle.com/technetwork/java/javase/downloads/index.html

Default installation path: C:\Program Files\java

Add environment variables for Java and javac, path: C:\Program files\java\jdk1.8.0_101\bin

Compile Java command: javac-d java file path (will generate a. class file with the same name)

Run Java command: Java javaclass file path

Basic Java Program rules:

    1. Java program must take the main method as the entry point, all main methods are: public static void Main (string[] args) fixed
    2. Java program One source file can only have a public class, can have more than one class file (non-public)
    3. Java files are named in the same class name as public

Problems:

    1. After Java 1.5 can not set classpath, if you want to set classpath, do not forget to add (.) Force Java to compile the program under the current path
    2. Capitalization issues. Java is case-sensitive Hello and hello are different
    3. The path contains spaces, the installation of the Java SDK is best installed in a folder without spaces (the default C:\Program Files are spaces, may cause problems)
    4. Main method if you want to run a Java program directly with the Java command, there must be a main method, and this method must be written as public static void main (string[] args)

One of the Java Learning Essays: A Java language overview and development environment

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.