Summary of basic Java Basics-----Common DOS commands (i)

Source: Internet
Author: User
Tags clear screen

Common DOS commands
    1. Dir (directory): Lists the files and folders in the current directory
    2. mkdir (make directory): Creating a Directory
    3. RD (remove directory): Delete directory
    4. CD (change directory) changes the specified directory (enter the specified directory)
    5. Del (delete): Delete files, delete a bunch of suffix names like files *.txt
    6. Move: Moving files
    7. -classpath: The location of the specified point
    8. CLS: (Clear screen) clear
    9. -D: Search

Example: ( . refers to the current directory;   .. refer to the top level directory)

CD://Return to top level directory

Java-classpath "c:/;D:/;." Pk1.my//point to C, D drives and current directory

Javac-d "." Todaynews.java//Search but todaynews under the previous directory and compile

Extended

1. How to open the command window:

①. Windows + R

②. Directly under the corresponding folder, SHIFT + right, select "Open Command Window Here"

2. Compiling, running

Compile the program (. java file) to generate a. class file (take Binary.java as an example). After the build succeeds and runs the program. (-D refers to a search, ".") Refers to the current directory)

The Javac compiler takes a class as a unit and each class class is translated into a bytecode file that is a. class file.

Javac-d "." Binary.java//Compiling programs

Java Binary//Run Program

3. Java configuration on cmd

Java-version

4. Package as a. jar file (7.20 is a packaged folder, test is the name of the packaged file)

Jar CVF Test.jar 7.20/

5.classpath function, value, how to specify;

Classpath tells JVN where to load bytecode files. There are two types of values.

How to specify CLASSPATH:

The ① directory and library file (jar) can specify values for the JVM through the-CP,-classpath parameter options.

② can be specified by environment variable Classpath

Summary of basic Java Basics-----Common DOS commands (i)

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.