List of arguments for scheduled task

argumentsscheduled-tasks

When you edit the action of a Scheduled Task, there's the option of "Add arguments".

The software I use right now has the argument

-cp .\Acquisition.Jar et.EPC

I've been googling for a while and couldn't find what -cp does.

Is there a list somewhere of these arguments? Are they related to the program used and if so, how can I find the list?

Best Answer

What is a -cp argument (option)

Your program is a Java program.

In this case you need to be aware that there are options and arguments which are different entities.

The option -cp (short for -classpath) specifies a list of directories, JAR files, and ZIP archives to search for class files.

The other possible options for a Java program are documented in java - Launches a Java application.

The values after the jar file name are arguments that are passed to the main method. You will need to refer to the documentation provided with the jar file to see the allowed arguments and their meaning.


The Java command line

Synopsis

java [ options ] class [ arguments ]

java [ options ] -jar file.jar [ arguments ]

javaw [ options ] class [ arguments ]

javaw [ options ] -jar file.jar [ arguments ]

options

  • Command-line options. See Options.

class

  • The name of the class to be called.

file.jar

  • The name of the JAR file to be called. Used only with the -jar command.

arguments

  • The arguments passed to the main function.

...

Standard Options

...

-classpath classpath

-cp classpath

Specifies a list of directories, JAR files, and ZIP archives to search for class files. Separate class path entries with semicolons (;). Specifying -classpath or -cp overrides any setting of the CLASSPATH environment variable.

If -classpath and -cp are not used and CLASSPATH is not set, then the user class path consists of the current directory (.).

As a special convenience, a class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension .jar or .JAR. A Java program cannot tell the difference between the two invocations.

For example, if directory mydir contains a.jar and b.JAR, then the class path element mydir/* is expanded to a A.jar:b.JAR, except that the order of jar files is unspecified. All jar files in the specified directory, even hidden ones, are included in the list. A class path entry consisting simply of * expands to a list of all the jar files in the current directory. The CLASSPATH environment variable, where defined, will be similarly expanded. Any class path wildcard expansion occurs before the Java VM is started. No Java program will ever see wild cards that are not expanded except by querying the environment. For example, by calling System.getenv("CLASSPATH").

Source java - Launches a Java application.

Related Question