Jar文件類的shell腳本對象時,通過QTPJar文件類打通命令提示符但noClassDefFound執行時通過QTP
的shell腳本對象都跑通過命令提示符但noClassDefFound得到執行我寫一個類來取來自websphere MQ的數據並將其保存爲MQTools.Jar可運行。
我嘗試創建一個shell腳本對象,並在線程中使用運行命令異常「主要」 java.lang.NoClassDefFoundError:BEC/MQ /工具/ MQClass
Set objShell = CreateObject("Wscript.Shell")
If instr(1,objShell.Environment.item("classpath"), strJavaFilePath, 1) > 0 Then 'javafilepath is path to the runnable Jar
Else
objShell.Environment.item("classpath") = objShell.Environment.item("classpath") & ";"&strJavaFilePath
End If
objShell.Run("cmd /c set classpath="& objShell.Environment.item("classpath"))
intReturn = objShell.Run ("cmd /c java bec.MQ.Tools.MQClass" & " "& strCommandLineArgs, 1, true) 'This line throws noclassdeffound error
我使用相同的命令,複製並粘貼到一個命令窗口,它運行非常順利,沒有錯誤。任何人都可以請建議