错误:在Linux中找不到或加载主类xxx.jar

时间:2019-05-24 04:47:00

标签: java linux bash redhat

我遇到错误:在Linux中运行bash时找不到或加载主类,但是在Windows上的.bat文件中运行它时工作正常。

这是重击

jrepath="/usr/bin/java"

classpath="ALMConnector/*"

echo ${classpath}

${jrepath} -cp ${classpath} alm.db.UploadToALMmain ${csvFilePath}

${jrepath} -cp ${classpath} alm.db.PublishTestResult ${resultFolder} ${almUsername} ${almPassword} ${almResultfile}

当前工作目录是ALMConnector的父目录。

这是运行良好的批处理文件。

set jrepath="C:\Program Files\Java\jdk1.8.0_141\bin\java.exe"

set classpath=ALMConnector\*

%jrepath% alm.db.UploadToALMmain %csvFilePath%

%jrepath% alm.db.PublishTestResult %resultFolder% %almUsername% %almPassword% %almResultfile%

在Linux上运行bash时出错:

[Step 4/4] ALMConnector/ALMConnector-1.0-SNAPSHOT.jar ALMConnector/commons-beanutils-1.9.2.jar ALMConnector/commons-codec-1.10.jar ALMConnector/commons-collections-3.2.1.jar ALMConnector/commons-lang3-3.4.jar ALMConnector/commons-logging-1.1.1.jar ALMConnector/EncryptIt-1.0.jar ALMConnector/joda-time-2.3.jar ALMConnector/opencsv-2.4.jar ALMConnector/opencsv-2.4-sources.jar ALMConnector/opencsv-3.8.jar ALMConnector/slf4j-api-1.7.21.jar ALMConnector/univocity-parsers-2.2.3.jar ALMConnector/uploadToAlm.jar ALMConnector/zipFolderInMemory.jar ALMConnector/zt-zip-1.8.jar
[09:50:01]  [Step 4/4] Error: Could not find or load main class ALMConnector.commons-beanutils-1.9.2.jar
[09:50:01]  [Step 4/4] Error: Could not find or load main class ALMConnector.commons-beanutils-1.9.2.jar

0 个答案:

没有答案