Use Java-CP

Source: Internet
Author: User

Create a world. Java class file with the path E: \ test \ com \ Hi \ world. java. The file content is

Package com. Hi;

Public class world {
Public static void main (string ARGs []) {
System. Out. println ("world !!! ");
}
}

Use javac to compile world. Java:
1 E: \ test \ com \ Hi>Javac world. Java
2 any path XXX>Javac E: \ test \ com \ Hi \ world. Java

Use Java to execute world. Java in two ways:
1 E: \ test>Java-CP. com. Hi. WorldWhere.The current class path is E: \ test.
2 any path XXX>Java-cp e: \ test com. Hi. World

Note: If the Java file contains package com. Hi, the final parameter of the execution class file must use the full name com. Hi. World of the class name instead of world.

Even if: any path XXX>Java-cp e: \ test \ com \ Hi worldNo.

If it is reprinted, please explain the source! Http://blog.csdn.net/xukunddp

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.