<tfoot id='AXJ60'></tfoot>
      • <bdo id='AXJ60'></bdo><ul id='AXJ60'></ul>
      <legend id='AXJ60'><style id='AXJ60'><dir id='AXJ60'><q id='AXJ60'></q></dir></style></legend>
    1. <i id='AXJ60'><tr id='AXJ60'><dt id='AXJ60'><q id='AXJ60'><span id='AXJ60'><b id='AXJ60'><form id='AXJ60'><ins id='AXJ60'></ins><ul id='AXJ60'></ul><sub id='AXJ60'></sub></form><legend id='AXJ60'></legend><bdo id='AXJ60'><pre id='AXJ60'><center id='AXJ60'></center></pre></bdo></b><th id='AXJ60'></th></span></q></dt></tr></i><div id='AXJ60'><tfoot id='AXJ60'></tfoot><dl id='AXJ60'><fieldset id='AXJ60'></fieldset></dl></div>

      <small id='AXJ60'></small><noframes id='AXJ60'>

        Ant在哪里设置它的'java.home'(它是错误的),

        时间:2023-09-27

          <small id='yYmLT'></small><noframes id='yYmLT'>

            <tfoot id='yYmLT'></tfoot>

            <i id='yYmLT'><tr id='yYmLT'><dt id='yYmLT'><q id='yYmLT'><span id='yYmLT'><b id='yYmLT'><form id='yYmLT'><ins id='yYmLT'></ins><ul id='yYmLT'></ul><sub id='yYmLT'></sub></form><legend id='yYmLT'></legend><bdo id='yYmLT'><pre id='yYmLT'><center id='yYmLT'></center></pre></bdo></b><th id='yYmLT'></th></span></q></dt></tr></i><div id='yYmLT'><tfoot id='yYmLT'></tfoot><dl id='yYmLT'><fieldset id='yYmLT'></fieldset></dl></div>
              • <legend id='yYmLT'><style id='yYmLT'><dir id='yYmLT'><q id='yYmLT'></q></dir></style></legend>
                  <tbody id='yYmLT'></tbody>
                  <bdo id='yYmLT'></bdo><ul id='yYmLT'></ul>
                  本文介绍了Ant在哪里设置它的'java.home'(它是错误的),它应该附加'/jre'吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  好的,我在 CentOS 6.3 上使用 Ant 版本 1.7.1(默认安装):

                  Okay, I'm using Ant version 1.7.1 (default install) on CentOS 6.3:

                  [theuser@dev-ingyhere ~]$ ant -version
                  Apache Ant version 1.7.1 compiled on August 24 2010
                  [theuser@dev-ingyhere ~]$ cat /etc/*-release
                  CentOS release 6.3 (Final)
                  

                  我设置了 JAVA_HOME 并运行 ant:

                  I have JAVA_HOME set and I run ant:

                  [theuser@dev-ingyhere ~]$ export JAVA_HOME=/usr/java/jdk1.7.0_17 ; echo $JAVA_HOME ;
                  /usr/java/jdk1.7.0_17
                  [theuser@dev-ingyhere ~]$ ant -diagnostics | grep java\.home
                  java.home : /usr/java/jdk1.7.0_17/jre
                  

                  这更有趣:

                  [theuser@dev-ingyhere ~]$ export JAVA_HOME=/a/fools/folly ; echo $JAVA_HOME ; ant -diagnostics | grep java\.home
                  /a/fools/folly
                  java.home : /usr/java/jdk1.7.0_17/jre
                  [theuser@dev-ingyhere ~]$  env | grep JAVA
                  JAVA_HOME=/a/fools/folly 
                  

                  所以,我确实得到了一件事——显然 Oracle 的 Java 7 Javadoc for Class System 是错误的(令人震惊!),其中将 java.home 系统属性描述为Java 安装目录".我知道这是因为 Java(TM) 系统属性教程将 java.home 系统属性描述为Java 运行时环境 (JRE) 的安装目录".换句话说,环境中的 JAVA_HOME 不一定等于 JVM 系统属性中的 java.home.(什么设置?!)

                  So, I do get one thing -- apparently Oracle's Java 7 Javadoc for Class System is WRONG (aghast!) where it describes the java.home System Property as the "Java installation directory." I know that because the Java(TM) Tutorials for System Properties describes the java.home System Property as the "Installation directory for Java Runtime Environment (JRE)." In other words the JAVA_HOME in the environment does not necessarily equal java.home in the JVM System Properties. (What sets that?!)

                  问题:Ant 在哪里以及如何获取/设置系统属性 java.home?

                  QUESTION: Where and how does Ant get/set the system property java.home?

                  推荐答案

                  真是一个JVM内部问题

                  由于 Ant 只是在回应 java.lang.System 属性(请参阅上面原始帖子下的评论),这确实是一个 JVM 问题.Java HotSpot 虚拟机 是核心解释器.代码可在 hg.openjdk.java.net 上在线获取.

                  Since Ant is just echoing the java.lang.System properties (see comment above under original post), this is really a JVM question. The Java HotSpot Virtual Machine is the core interpreter. Code is available online at hg.openjdk.java.net.

                  C++代码第309行对于 HotSpot (os_linux.cpp),在 os 类中有一个 init_system_properties_values() 方法.它做了一些温和的启发式方法来嗅出一个名为 home_path 的变量的位置,该变量最终被设置为 Java 用户所看到的java.home".代码中的注释表明<java_home>/jre"被正式指定为java.home"的 java.lang.System 属性值(在 JDK 安装的情况下).

                  On line 309 of the C++ code for HotSpot (os_linux.cpp) there is a an init_system_properties_values() method in the os class. It does some mild heuristics to kind of sniff out the location for a variable named home_path which ends up being set to what Java users see as "java.home". Comments in the code indicate that '<java_home>/jre' is being formally specified as the java.lang.System property value for "java.home" (in the case of a JDK install).

                  这篇关于Ant在哪里设置它的'java.home'(它是错误的),它应该附加'/jre'吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:无法加载库“tesseract":libtesseract.so:无法打开共 下一篇:Java 8、JCE 无限强度策略和基于 TLS 的 SSL 握手

                  相关文章

                  最新文章

                • <small id='5HXzC'></small><noframes id='5HXzC'>

                    <bdo id='5HXzC'></bdo><ul id='5HXzC'></ul>
                  <legend id='5HXzC'><style id='5HXzC'><dir id='5HXzC'><q id='5HXzC'></q></dir></style></legend>

                  <tfoot id='5HXzC'></tfoot>

                      <i id='5HXzC'><tr id='5HXzC'><dt id='5HXzC'><q id='5HXzC'><span id='5HXzC'><b id='5HXzC'><form id='5HXzC'><ins id='5HXzC'></ins><ul id='5HXzC'></ul><sub id='5HXzC'></sub></form><legend id='5HXzC'></legend><bdo id='5HXzC'><pre id='5HXzC'><center id='5HXzC'></center></pre></bdo></b><th id='5HXzC'></th></span></q></dt></tr></i><div id='5HXzC'><tfoot id='5HXzC'></tfoot><dl id='5HXzC'><fieldset id='5HXzC'></fieldset></dl></div>