Before you learn Java

Source: Internet
Author: User

Statement: The material used in this column is written by the VIP students of the Kay Academy, who has the right to be anonymous and has the final right to interpret the article; The Edith Academy is designed to promote students to learn from each other on the basis of public notes.

Before you learn Java

2.1 Understanding the JDK Toolkit:
Compiling and running it uses the JDK to compile and run, first to download the JDK; Installation of 1.JDK:
JDK's official website: (http://www.oracle.com) find a place by following these steps:

2. Install the JDK:
Double-click the Jdk-8u144-windows-x64.exe and enter the installation:

Then the file generated under the path you wrote is the location of the JDK directory:

3. Environment variables:
is to store a path data that facilitates the program to read the data. In other words, there are many paths in DOS, and the environment variable is the configuration path. When you run the program in CMD, the computer will look in the configured environment variable one at a time until it is found. This simplifies the operation and facilitates the search.
Java process:
1. Write Good code

 Public class Wed Public  staticvoidmain(string[] S1) {          System. out. println ("Kaigo over Bald");}  }

2. Compiling

Dos Windows common commands:
Dir View current directory file or clip;
Cd\ return to the parent directory;
(drive letter name) + (:) Enter the letter of the join;

3. Running

To configure the PATH environment variable:

DOS: In the computer is just a disk manager, file data deletion and replacement, you can also run the relevant program of an operating system.
CLASSPATH environment variable: is the path to the bytecode.
1. When we run a Hello.java program, we need to compile the code, form the middle code, when we want to run DOS to find your parameters Hello and then go to prepare to find Hello.class file, in the search he will ask your classpath if there is, if present, press Classpath with Set the path to go, will be loaded hello.class start success;
2. If it does not exist, follow your local path to find Hello.class, when you do not have a local error, and some words will run.
When you can't find Hello.class locally:

If the error is still the following questions:
1. Is your writing the case is wrong;
2. Are your paths hello.class;
3. Your classpath is not configured with a path;
4. Or your class version problem;

Class version problem: You are compiling Hello.java with a high version of the JDK and running Hello.class on the lower version of the JDK.

To configure the CLASSPATH environment variable:
1. You can configure temporary in DOS: set classpath= the path you directed;
After searching the classpath, there is a need to search the local area: add it after the path you have directed, or add it in front.

Javaclass Compatibility: The compiled class file can be up-to-the-compatible, not compatible;
Feel free to point to classpath:
is not to use the CLASSPATH you configured to run when I randomly point to a path to find the class file.

such as D:d:/> SET classpath1=d:d:/> java-classpath%classpath1%  F:  />-classpath c:/F:/>hello, nba!

is to randomly point to a path to find the class file, configuring the specified path for class:.
Like what:

Java_home:
Is the complete directory of JDK: C:\Program files\java\jdk1.8.0_144

Before you learn Java

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.