JAVA-CP command java jar command and Hadoop jar command

Source: Internet
Author: User

Like-CP and-classpath, it is the path to the other classes that the specified class runs on, usually the class library, the jar package, and the full path to the jar package, the semicolon ";" JAVA-CP on the window. Myclass.jar Packname.mainclassname
The jar file in the classpath can use wildcards, and if it is multiple jar files, it should be listed one by one, and in a sense the jar file is the path.

To specify a specific storage path for each jar file, multiple wildcard characters can be used for the same path
JAVA-CP.; C:\classes\myclass.jar;d:\classes\*.jar packname.mainclassname java jar can be executed via Java jar Log.jar [parameters] Http://www.cnblogs . com/adolfmc/archive/2012/10/07/2713562.html an executable jar of the MANIFEST.MF file inside the specified run Manclass

manifest-version:1.0
Class-path:.
Main-class:my.hadoop.hdfs.createlog.createlog

In a package exported with Maven, if the dependency package is not hit in the Pom file, there is no dependency on the package

1, the main class is specified when packing, can be used directly with Java-jar Xxx.jar

2, packaging is not specified main class, you can use JAVA-CP Xxx.jar main class name (absolute path)

3, to refer to other jar packages, you can use Java-classpath $CLASSPATH: Xxxx.jar main class name (absolute path)

-CLASSPATH specifies the classes to be introduced;

The Hadoop jar adds all of the jar packages that Hadoop relies on when executing the Java CP without a manual add-on effect

JAVA-CP command java jar command and Hadoop jar command

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.