简体   繁体   English

执行批处理文件

[英]Executing a batch file

I have one query , I have P: drive in my system and it contains a folder name DeviceJars which contain different jars and one of jar name pinpadservice.jar is inside it. 我有一个查询,我的系统中有P:驱动器,它包含一个名为DeviceJars的文件夹,其中包含不同的jar,并且其中一个jar名称为pinpadservice.jar。

Now I am trying to run a batch file named pinpadservice.bat and the pinpadservice.bat contains 现在,我试图运行一个名为pinpadservice.bat的批处理文件,并且pinpadservice.bat包含

"%JAVA_HOME%"\bin\java -cp p:\DeviceJars\PinpadService.jar main/PinpadServiceMain

But rite now I am trying to execute it through command window but it is not executing please advise do I need to set the classpath for it like.. 但是,现在我试图通过命令窗口执行它,但是它没有执行,请告知我是否需要为其设置类路径。

set CLASSPATH=%CLASSPATH%;C:\\DeviceJars\\pinpadservice.jar and then tring to execut the batch file 设置CLASSPATH=%CLASSPATH%;C:\\DeviceJars\\pinpadservice.jar ,然后尝试执行批处理文件

Set the CLASSPATH in the script; 在脚本中设置CLASSPATH; don't depend on any environment variable. 不依赖于任何环境变量。 Add all the JARs your app needs into the -cp value, separated by semi-colons. 将您的应用程序需要的所有 JAR添加到-cp值中,以分号分隔。

All Java EE IDEs and app servers ignore CLASSPATH environment variables. 所有Java EE IDE和应用程序服务器都会忽略CLASSPATH环境变量。 I don't set it that way on any machine that I work on. 我不会在我使用的任何计算机上进行这种设置。

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

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