当我尝试从 Windows 机器执行我的 testng 时,我可以毫无问题地执行 mky 测试。
我正在使用命令:java -cp bin;jarslib/* org.testng.TestNG testng.xml
我在项目文件夹内的 jarslib 文件夹中拥有我的所有 jar。
但是当我从 MAC OS 执行时,出现以下错误:
Usage: java [-options] class [args...]
(to execute a class)
或 java [-options] -jar jarfile [args...](执行 jar 文件),其中选项包括: -d32 使用 32 位数据模型(如果可用) -d64 使用 64 位数据模型(如果可用) -server选择“服务器”VM 默认的VM 是服务器,因为你是在服务器级机器上运行的。
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A : separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
Warning: this feature is deprecated and will be removed
in a future release.
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
Warning: this feature is deprecated and will be removed
in a future release.
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
有关更多详细信息,请参阅http://www.oracle.com/technetwork/java/javase/documentation/index.html。jarslib/bsh-2.0b6.jar: line 1: PK: command not found jarslib/bsh-2.0b6.jar: line 2: ?EH: command not found jarslib/bsh-2.0b6.jar: line 3: command not found jarslib/bsh-2.0b6.jar:第 4 行:意外标记附近的语法错误)' jarslib/bsh-2.0b6.jar: line 4:
?EH?Je?^META-INF/MANIFEST.MFm??N1 ??Hy?eH.9t?D{C???.)M ???oO'
由于类路径中的分号,shell 将您的命令解释为 2 个命令。使用冒号 (:) 作为分隔符:
java -cp bin:jarslib/* org.testng.TestNG testng.xml
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句