Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将参数从windows批处理脚本传递到java_Windows_Batch File - Fatal编程技术网

如何将参数从windows批处理脚本传递到java

如何将参数从windows批处理脚本传递到java,windows,batch-file,Windows,Batch File,我需要在java程序中读取windows批处理脚本中定义的一些参数。。。 如何定义参数。。? 例如 我需要读取脚本中定义的变量; 变量v=XYX 我试着(在脚本中)定义like 但有以下例外 Usage: java [-options] class [args...] (to execute a class) or java [-options] -jar jarfile [args...] (to execute a jar file) w

我需要在java程序中读取windows批处理脚本中定义的一些参数。。。 如何定义参数。。? 例如 我需要读取脚本中定义的变量; 变量v=XYX

我试着(在脚本中)定义like

但有以下例外

Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)

where options include:
    -client       to select the "client" VM

您必须首先调用类的main方法

java com.xyz.MyClass-Dvariable=XYX

Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)

where options include:
    -client       to select the "client" VM