简体   繁体   中英

Meaning of “*:” in java classpath specification

I have a Java project uncompiled. Entry point is the main method in maui.main.MauiModelBuilder which is passed some parameters by command line.

The author of the code provides this suggestion to compile it:

java -cp "lib/*:src" maui.main.MauiModelBuilder -l data/automatic_tagging/train/ -m test -v none

What's the meaning of "lib/*:src" in this case? I never saw such a syntax.

Actually, you are parsing this syntax incorrectly in your head. You should be reading it as "lib/*" and "src" . This syntax means that we are adding:

  • all files under the lib folder
  • the src file

to the classpath of java .

: is used as a separator for classpath entry.

'*' is a wildcard character that match anything.

In this case 'lib/*' add all file under 'lib' directory and ':' is a seperator thus 'src' also included.

So your 'lib/*:src' add all file under 'lib' directory and 'src' under current directory.

"lib/*:src" means to include all files under lib directory and src. ":" is used as separator,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM