开发者

java ant: specify which java installation should be used to run

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 开发者_如何学Pythonversion.

thanks!


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.


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.


Use the JAVACMD environment variable (see here)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜