Discuss / Java / 在项目目录下执行-classpath,好像没有找到这个命令

在项目目录下执行-classpath,好像没有找到这个命令

Topic source

summer_T1

#1 Created at ... [Delete] [Delete and Lock User]
java -classpath . 
                                                                                                                                                 1 ↵  
用法:java [options] <主类> [args...]
           (执行类)
   或  java [options] -jar <jar 文件> [args...]
           (执行 jar 文件)
   或  java [options] -m <模块>[/<主类>] [args...]
       java [options] --module <模块>[/<主类>] [args...]
           (执行模块中的主类)
   或  java [options] <源文件> [args]
           (执行单个源文件程序)

廖雪峰

#2 Created at ... [Delete] [Delete and Lock User]
$ java -h
Usage: java [options] <mainclass> [args...]
           (to execute a class)
   or  java [options] -jar <jarfile> [args...]
           (to execute a jar file)
   or  java [options] -m <module>[/<mainclass>] [args...]
       java [options] --module <module>[/<mainclass>] [args...]
           (to execute the main class in a module)
   or  java [options] <sourcefile> [args]
           (to execute a single source-file program)

 Arguments following the main class, source file, -jar <jarfile>,
 -m or --module <module>/<mainclass> are passed as the arguments to
 main class.

 where options include:

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>

summer_T1

#3 Created at ... [Delete] [Delete and Lock User]

对,就是用  java -classpath .  命令,直接弹出帮助信息了。命令好像没有生效

summer_T1

#4 Created at ... [Delete] [Delete and Lock User]

没事了,是我没仔细看文档😂


  • 1

Reply