【发布时间】:2018-08-15 17:45:17
【问题描述】:
当我尝试从 Windows 机器执行我的 testng 时,我能够毫无问题地执行 mky 测试。
我正在使用命令:java -cp bin;jarslib/* org.testng.TestNG testng.xml
我在项目文件夹中的 jarslib 文件夹中拥有我所有的 jars。
但是当我从 MAC OS 执行时,我收到以下错误:
Usage: java [-options] class [args...]
(to execute a class)
或 java [-options] -jar jarfile [args...] (执行一个jar文件) 其中选项包括: -d32 使用 32 位数据模型(如果可用) -d64 使用 64 位数据模型(如果可用) -server 选择“服务器”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:第 1 行:PK:找不到命令
jarslib/bsh-2.0b6.jar:第 2 行:
?EH: 找不到命令
jarslib/bsh-2.0b6.jar:第 3 行:找不到命令
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'
【问题讨论】: