java ant:指定应使用哪个java安装来运行

发布于 2024-09-04 21:51:17 字数 101 浏览 1 评论 0原文

是否可以指定系统上的哪个 java 安装用于运行 java任务? 如果是,怎么办?

就我而言,我想指定是否要运行 32 位版本或 64 位版本。

谢谢!

is it possible to specify which installation of java on the system should be used to run a
java task?
if yes, how?

in my case i want to specify if i want to run the 32bit or the 64bit version.

thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

季末如歌 2024-09-11 21:51:17

我相信这就是 < 的 jvm 属性;java>Ant任务是关于。

jvm - 用于调用Java虚拟机的命令,默认为'java'。该命令由 java.lang.Runtime.exec() 解析。如果 fork 被禁用,则忽略。

I believe this is what jvm attribute of the <java> Ant task is about.

jvm - the command used to invoke the Java Virtual Machine, default is 'java'. The command is resolved by java.lang.Runtime.exec(). Ignored if fork is disabled.

倾`听者〃 2024-09-11 21:51:17

来自 http://ant.apache.org/manual/Tasks/java.html

fork 是否在外部使用JDK编译器执行javac;默认为 no

可执行文件 在 fork="yes" 的情况下使用的 javac 可执行文件的完整路径。默认为当前运行 Ant 的 Java 版本的编译器。如果 fork="no" 则忽略。
从 Ant 1.6 开始,当使用 jikes、jvc、gcj 或 sj 时,此属性还可用于指定可执行文件的路径。

From http://ant.apache.org/manual/Tasks/java.html

fork Whether to execute javac using the JDK compiler externally; defaults to no

executable Complete path to the javac executable to use in case of fork="yes". Defaults to the compiler of the Java version that is currently running Ant. Ignored if fork="no".
Since Ant 1.6 this attribute can also be used to specify the path to the executable when using jikes, jvc, gcj or sj.

欲拥i 2024-09-11 21:51:17

使用 JAVACMD 环境变量(请参阅此处

Use the JAVACMD environment variable (see here)

长不大的小祸害 2024-09-11 21:51:17

由于 命令不允许您指定 JVM,因此我建议您使用 直接执行您想要的确切 java 二进制文件和命令行。

Since the <java> command doesn't let you specify the JVM, I'd suggest you use <exec> directly to execute the exact java binary and command line you want.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文