It is because as implementation when we parse command line argument it "stopAtNonOptions" at the arbitrary content user jar. All arguments later will be regarded as args passed to user main.

For user serving, when you run `./bin/flink run -h`, it prints

Action "run" compiles and runs a program.

  Syntax: run [OPTIONS] <jar-file> <arguments>

that explicit explains the format.


tison <> 于2020年3月6日周五 下午10:22写道:
I think the problem is that --classpath should be before the user jar, i.e., /opt/flink/job/kafkaDemo19-1.0-SNAPSHOT.jar


Aljoscha Krettek <> 于2020年3月6日周五 下午10:03写道:

first a preliminary question: does the jar file contain Could you maybe list the contents of the jar


On 06.03.20 13:25, ouywl wrote:
> Hi all
>       When I start a flinkcluster in session mode, It include jm/tm. And then I
> submit a job like ‘bin/flink run —jobmanager “ip:8081” —class path  a.jar’. Even
> the a.jar in all jm/tm and ‘bin/flink’ mechine . It will throw exception “
> /opt/flink/bin/flink run --jobmanager ip:8081 --class
> --parallelism 1 --detached
> /opt/flink/job/kafkaDemo19-1.0-SNAPSHOT.jar --classpath
> file:///opt/flink/job/fastjson-1.2.66.jar
> Starting execution of program
> Executing TopSpeedWindowing example with default input data set.
> Use --input to specify file input.
> java.lang.NoClassDefFoundError: com/alibaba/fastjson/JSON
> at
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> at java.lang.reflect.Method.invoke(
> at
> org.apache.flink.client.program.PackagedProgram.callMainMethod(
> at
> org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(
> at
> at org.apache.flink.client.cli.CliFrontend.executeProgram(”
>    As I read the code , flink cli have not load the —classspath jar, So It seems
> a bug about the flink cli. Are you agree with me?
> Best,
> Ouywl