我正在尝试运行一个ant build来生成一个jar,我收到以下错误:
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-0.b14.el7_2.x86_64/lib/tools.jar Buildfile: /my/path/to/the/required.xml make: [javac] /my/path/to/the/required..xml:11: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds BUILD FAILED /my/path/to/the/required.xml:11: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "/usr/lib/jvm/java-1.8.0-openjdk- 1.8.0.91-0.b14.el7_2.x86_64/jre"我的问题:1。我做了一些在线阅读,我得出结论,因为我指的是JRE而不是JDK,这就是它失败的原因。 最初我做了
export JAVA_HOME=readlink -f $(which java)
所以我更新并导出了我的JAVA_HOME变量,其输出为which javac命令。 有趣的是,错误的最后一部分没有显示更改的JAVA_HOME值。 这是为什么?
什么是includeantruntime和如何摆脱它? 我用ant 1.9.2I am trying to run an ant build to generate a jar and i get the following error:
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-0.b14.el7_2.x86_64/lib/tools.jar Buildfile: /my/path/to/the/required.xml make: [javac] /my/path/to/the/required..xml:11: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds BUILD FAILED /my/path/to/the/required.xml:11: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "/usr/lib/jvm/java-1.8.0-openjdk- 1.8.0.91-0.b14.el7_2.x86_64/jre"My questions: 1. I did a bit of reading online and i concluded its because i am pointing it to the JRE and not JDK which is why it failed. Initially i did
export JAVA_HOME=readlink -f $(which java)
So i updated and exported my JAVA_HOME variable with output of which javaccommand. What is interesting is that last part of the error did not display the changed JAVA_HOME value. Why is that?
What is this includeantruntime and how to get rid of it? I use ant 1.9.2最满意答案
您可能需要检查并更新JAVA_HOME设置的ant配置文件。 在.bashrc中为shell设置的$ JAVA_HOME的值可能会在文件/etc/ant.conf, $ HOME / .ant / ant.conf和$ HOME / .antrc中被覆盖。 如果执行bash -x,它将打印调试信息,这些信息可以帮助您跟踪$ JAVA_HOME被覆盖的位置。
You may want to check and update ant configuration file for the JAVA_HOME settings. It is possible that the value for $JAVA_HOME set for your shell in .bashrc can be overridden in the files /etc/ant.conf, $HOME/.ant/ant.conf, and $HOME/.antrc. If you execute bash -x it will print debugging information which should help you track down where $JAVA_HOME is being overridden.
Ant构建 - JAVA_HOME变量未更新(Ant build - JAVA_HOME variable not getting updated)我正在尝试运行一个ant build来生成一个jar,我收到以下错误:
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-0.b14.el7_2.x86_64/lib/tools.jar Buildfile: /my/path/to/the/required.xml make: [javac] /my/path/to/the/required..xml:11: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds BUILD FAILED /my/path/to/the/required.xml:11: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "/usr/lib/jvm/java-1.8.0-openjdk- 1.8.0.91-0.b14.el7_2.x86_64/jre"我的问题:1。我做了一些在线阅读,我得出结论,因为我指的是JRE而不是JDK,这就是它失败的原因。 最初我做了
export JAVA_HOME=readlink -f $(which java)
所以我更新并导出了我的JAVA_HOME变量,其输出为which javac命令。 有趣的是,错误的最后一部分没有显示更改的JAVA_HOME值。 这是为什么?
什么是includeantruntime和如何摆脱它? 我用ant 1.9.2I am trying to run an ant build to generate a jar and i get the following error:
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-0.b14.el7_2.x86_64/lib/tools.jar Buildfile: /my/path/to/the/required.xml make: [javac] /my/path/to/the/required..xml:11: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds BUILD FAILED /my/path/to/the/required.xml:11: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "/usr/lib/jvm/java-1.8.0-openjdk- 1.8.0.91-0.b14.el7_2.x86_64/jre"My questions: 1. I did a bit of reading online and i concluded its because i am pointing it to the JRE and not JDK which is why it failed. Initially i did
export JAVA_HOME=readlink -f $(which java)
So i updated and exported my JAVA_HOME variable with output of which javaccommand. What is interesting is that last part of the error did not display the changed JAVA_HOME value. Why is that?
What is this includeantruntime and how to get rid of it? I use ant 1.9.2最满意答案
您可能需要检查并更新JAVA_HOME设置的ant配置文件。 在.bashrc中为shell设置的$ JAVA_HOME的值可能会在文件/etc/ant.conf, $ HOME / .ant / ant.conf和$ HOME / .antrc中被覆盖。 如果执行bash -x,它将打印调试信息,这些信息可以帮助您跟踪$ JAVA_HOME被覆盖的位置。
You may want to check and update ant configuration file for the JAVA_HOME settings. It is possible that the value for $JAVA_HOME set for your shell in .bashrc can be overridden in the files /etc/ant.conf, $HOME/.ant/ant.conf, and $HOME/.antrc. If you execute bash -x it will print debugging information which should help you track down where $JAVA_HOME is being overridden.
发布评论