The value "*:" in the specification of the Java class

I have a Java project without compilation. The entry point is the main method in maui.main.MauiModelBuilder , which passes some parameters on the command line.

The code author offers this suggestion for compiling it:

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

What is the meaning of "lib/*:src" in this case? I have never seen such a syntax.

+5
source share
3 answers

Actually, you do not parse this syntax correctly in your head. You should read it as "lib/*" and "src" . This syntax means that we add:

  • all files in the lib folder
  • src file

for the path to the java class.

: Used as a separator to write the class path.

+7
source

'*' is a wildcard character that matches any.

In this case, 'lib / *' adds the entire file to the 'lib' directory, and ':' is a seperator, so 'src' is also included.

So your 'lib / *: src' adds the whole file to the 'lib' directory and 'src' to the current directory.

+1
source

"lib/*:src" means including all files in the lib and src directory. ":" is used as a delimiter,

0
source

Source: https://habr.com/ru/post/1232538/


All Articles