简体   繁体   English

在自动化程序中运行 java 命令行工具时出现问题

[英]Trouble running java command line tool inside an automation program

I am using a.bat file, which is reliant on a.jar file.我正在使用 .bat 文件,该文件依赖于 a.jar 文件。 I have java (jdk/jre) installed on my system.我的系统上安装了 java (jdk/jre)。 If I run a command on this command line api via cmd (eg nscmd --help), everything works fine.如果我通过 cmd(例如 nscmd --help)在此命令行 api 上运行命令,一切正常。

However, I want to run commands inside another program (Automise www.automise.com).但是,我想在另一个程序(Automise www.automise.com)中运行命令。 If I do so, with the command line tools in another folder to Java, I get the infamous "java is not a recognised keyword...etc" error.如果我这样做,使用 Java 的另一个文件夹中的命令行工具,我会收到臭名昭著的“java 不是可识别的关键字...等”错误。 If I put the command line tools in the same folder as Java, I get this error:如果我将命令行工具放在与 Java 相同的文件夹中,我会收到此错误:

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object Program returned code: 1 VM java/lang/NoClassDefFoundError: java/lang/Object Program returned code: 1初始化VM时出错

How can I successfully run the command line tools?The tool is this: http://www.newservers.com/language/en/documentation/reference-nscmd.html怎样才能成功运行命令行工具?工具是这样的: http://www.newservers.com/language/en/documentation/reference-nscmd.html

Thanks谢谢

Add the directory java is in to your path variable.将目录 java 添加到您的路径变量中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM