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
我使用相同的命令,复制并粘贴到一个命令窗口,它运行非常顺利,没有错误。任何人都可以请建议