简体   繁体   English

使用参数运行jar文件,而不必使用命令行

[英]Run jar file with arguments without having to use command line

I am using Alpn-boot to add support for HTTP.2 requests using OkHttp . 我使用Alpn-boot ,以增加对HTTP.2使用OkHttp请求的支持。 In order for that to work i always have to launch my compiled jar file through the command line and specify the path of alpn-boot.jar file with a <-Xbootclasspath> argument : 为了alpn-boot.jar正常工作,我始终必须通过命令行启动编译的jar文件,并使用<-Xbootclasspath>参数指定alpn-boot.jar文件的路径:

java -jar -Xbootclasspath/p:<path_to_alpn-boot.jar> <path_to_myjar.jar>

Is there anyway to avoid this, and make the jar run with the -Xbootclasspath argument specified by default? 无论如何,要避免这种情况,并使用默认指定的-Xbootclasspath参数使jar运行?

Edit: I thought about using a batch file to do this, but is there no other native way? 编辑:我考虑过使用批处理文件来执行此操作,但是没有其他本机方法吗?

Batch file is convenient and standard enough. 批处理文件方便且足够标准。 Unless you have specific reason not to use batch file, batch file would do it 除非您有特定原因不使用批处理文件,否则批处理文件将执行此操作

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

相关问题 java-如何在Windows命令行中运行JAR文件,该命令行的运行时参数包含“&lt;”和“&gt;”字符 - java- how to run JAR file in Windows command line which has run time arguments containing “<” and “>” chars 无法从命令行运行jar文件 - Unable to run jar file from command line 在命令行中运行jar文件(由ant生成) - run a jar file (generated by ant) in command line 从 unix 命令行运行 jar 文件 - Run a jar file from unix command line 使用命令行中的参数从JAR运行Maven项目 - Run maven project from JAR with arguments from command line 您可以在不通过命令行的情况下运行 Java jar 文件吗? - Can you run a Java jar file without going through the command line? 如何在没有jar文件的命令行中编译和运行Netbeans java项目? - How to compile and run a Netbeans java project in command line without jar file? 如何在命令promt中运行带有参数和类路径的Java jar文件 - How to run a java jar file with arguments and classpath in command promt 使用命令行运行具有多个主类的 jar 文件 - Running a jar file having multiple main classes using command line Java .jar文件与命令行和文件资源管理器的运行方式不同 - Java .jar file Run Differently from Command Line and File Explorer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM