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.
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.
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.
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.
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:
lib
folderto the classpath of java
.
:
is used as a separator for classpath entry.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With