JAVA更新后无法配置JRE_HOME

时间:2016-04-18 09:05:17

标签: java eclipse ant

我已经搜索了有关设置ANT_HOME的相关帖子,但似乎没有解决我的问题。我已经尝试了所有步骤,但仍然没有变化。

这是我在执行' startTomcat'时输出的内容。目标:

CATALINA_HOME

环境变量如下:

用户变量:

  • JAVA_HOME:C:\ Program Files \ Apache Software Foundation \ apache-ant-1.9.6
  • Path:C:\ Program Files \ Apache Software Foundation \ Tomcat 8.0
  • CATALINA_HOME:C:\ Program Files \ Java \ jdk1.8.0_73
  • CLASSPATH: C:\ Program Files \ Apache Software Foundation \ apache-ant-1.9.6 \ bin; C:\ Program Files \ Apache Software Foundation \ apache-ant-1.9.6 \ bin

系统变量:

  • <!-- main body --> <body> <div class="container"> <div class="row"> <div class="col-md-6 col-md-offset-3 col-sm-offset-2 col-sm-8 col-xs-12"> <form class="credit"> <div class="form-group"> <!-- amount to borow --> <label for="amount">Amount To Borrow</label> <div class="input-group"> <div class="input-group-addon">EUR</div> <input id="amount" type="number" min="1" max="1000000" onchange="computeLoan()" class="form-control validate" id="amount" placeholder="Enter amount" required> </div> </div> <!-- End amount to borrow --> <!-- dropdown --> <div class="dropdown"> <select id= "rate" onchange="computeLoan()"> <option value="" disabled="disabled" selected="selected">Select A Loan Term</option> <span class="caret"></span></button> <ul class="dropdown-menu"> <option value="46.64">2 Years @ 46.64%</option> <option value="32.50">3 Years @ 32.50%</option> <option value="26.08">4 Years @ 26.08%</option> <option value="22.00">5 Years @ 22.00%</option> </ul> </select> </div> <!-- end dropdown --> <br> <!-- display the results --> <h3 id="monthlyPayment"></h3> <h4 id="totalPayment"></h4> <!-- end display results --> <h4 id="threeYears"></h4> <h4 id="fourYears"></h4> <h4 id="fiveYears"></h4> </div> </div> </form> <!-- end form --> </div> </div> </div> :C:\ Program Files \ Apache Software Foundation \ Tomcat 8.0
  • // conditional logic function computeLoan() { // grab the selected value of the dropdown box var r = document.getElementById("rate"); var rateSelected = parseFloat(r.value); //grab elements by their ID var amount = parseFloat(document.getElementById('amount').value); //do the maths do find the percentage var interest = (amount * (rateSelected * .01)) //Monthly payment var monthlyPayment = ((amount / 1000 ) * rateSelected).toFixed(2); monthlyPayment = monthlyPayment.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); // total payment var totalPayment = (monthlyPayment * 24).toFixed(2); totalPayment = totalPayment.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); var threeYears = (monthlyPayment * 36).toFixed(2); totalPayment = totalPayment.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); var fourYears = (monthlyPayment * 48).toFixed(2); totalPayment = totalPayment.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); var fiveYears = (monthlyPayment * 60).toFixed(2); totalPayment = totalPayment.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); // display the results document.getElementById('monthlyPayment').innerHTML = "Monthly Repayment: &euro;"+monthlyPayment; document.getElementById('totalPayment').innerHTML = "Total Repayment for 2 Years: &euro;"+totalPayment; document.getElementById('threeYears').innerHTML = "Total Repayment for 3 Years: &euro;"+threeYears; document.getElementById('fourYears').innerHTML = "Total Repayment for 4 Years: &euro;"+fourYears; document.getElementById('fiveYears').innerHTML = "Total Repayment for 5 Years: &euro;"+fiveYears; } :%JAVA_HOME%**

在更新Java之前,一切正常。我尝试重新安装JRE和JDK,但它仍然没有解决我的问题。希望得到明确的答案。

1 个答案:

答案 0 :(得分:-2)

尝试在eclipse中添加JAVA_HOME(在ANT运行配置中):

  1. 右键单击ANT构建文件,选择Run As&gt;外部工具配置
  2. 转到“环境”选项卡,然后单击“新建”以添加JAVA_HOME refer the image here
  3. 单击“应用并运行”
  4. 请在我的网站here中找到详细步骤。