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: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 '
クラスパスにセミコロンがあるため、シェルはコマンドを2つのコマンドとして解釈しています。代わりに、区切り文字としてコロン(:)を使用してください。
java -cp bin:jarslib/* org.testng.TestNG testng.xml
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加