Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 805
Leonardo Avatar asked Sep 29 '15 13:09

Leonardo


People also ask

What is the default CLASSPATH for Java?

From The Java™ tutorials: PATH and CLASSPATH: The default value of the class path is ".", meaning that only the current directory is searched. Specifying either the CLASSPATH variable or the -cp command line switch overrides this value.

What is CLASSPATH in Java with example?

CLASSPATH: CLASSPATH is an environment variable which is used by Application ClassLoader to locate and load the . class files. The CLASSPATH defines the path, to find third-party and user-defined classes that are not extensions or part of Java platform.

What is CLASSPATH environment variable?

Classpath is an environment variable that is used by the application ClassLoader or system to locate and load the compiled Java bytecodes stored in the . class file. To set CLASSPATH. the CLASSPATH can be overridden by adding classpath in the manifest file and by using a command like set -classpath.


1 Answers

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.

like image 117
Tunaki Avatar answered Oct 27 '22 02:10

Tunaki