如何从命令行运行带有 vm 参数的 java 项目? [英] How to run a java project with vm arguments from command line?

查看:32
本文介绍了如何从命令行运行带有 vm 参数的 java 项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个 maven 插件,它必须用特定的 VM 参数初始化另一个 java 项目.根据 exec:java,它们只接受参数而不接受 VMarguments,所以我的问题是如何从命令行启动具有特定 VMarguments 的 Java 项目?谢谢

I'm writing a maven plugin which has to initialize another java project with specific VM arguments. according to the exec:java, they only take in arguments but not VMarguments, so my question is how to launch a java project with specific VMarguments from the command line? thanks

推荐答案

如果你使用 Maven 的 exec:java 插件,你不能提供额外的 VM 参数,因为它运行在同一个 VM 中(即它已经被初始化).您需要使用 exec:exec,并自己构建 java 命令行.

You can't supply extra VM arguments if you use Maven's exec:java plugin because it runs in the same VM (i.e. it's already been initialized). You'll need to use exec:exec, and construct the java command line yourself.

这篇关于如何从命令行运行带有 vm 参数的 java 项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆