gpt4 book ai didi

windows - 使用未配置 JRE_HOME 的 digest.bat 退出创建摘要

转载 作者:可可西里 更新时间:2023-11-01 10:26:25 25 4
gpt4 key购买 nike

我正在尝试为一些密码创建摘要。

运行以下命令时

C:\Program Files\apache-tomcat-7.0.34\bin> digest.bat -a SHA-256 somepassword

我收到以下错误

The JRE_HOME environment variable is not defined correctly
This environment variable is needed to run this program

JRE_HOME 的值为 C:\Program Files\Java\jre7

我已经尝试过 .; 在前面 \bin 在后面(有和没有分号和/或尾随反斜杠)但问题仍然存在。

  1. tomcat的版本是7.0.34

  2. java版本为jre7

  3. 操作系统为Win7 Pro 64位

我的下一步是安装不同版本的 JRE,然后重试,我们将不胜感激。

最佳答案

%CATALINA_HOME%\bin\tool-wrapper.bat 文件中,从 digest.bat 中引用:

rem   JAVA_HOME       Must point at your Java Development Kit installation.
rem Using JRE_HOME instead works as well.
rem
rem JRE_HOME Must point at your Java Runtime installation.
rem Defaults to JAVA_HOME if empty. If JRE_HOME and JAVA_HOME
rem are both set, JRE_HOME is used.


换句话说,只需将 JAVA_HOME 设置为指向 JDK(不是 JRE)安装,一切都会正常工作(在我的机器上测试过)。

示例 JAVA_HOME 来 self 的机器:

JAVA_HOME=C:\Program Files\Java\jdk1.7.0_17

更新

来自位于 Tomcat 目录中的 running.txt 文件:

(3) Configure Environment Variables

Tomcat is a Java application and does not use environment variables. The variables are used by the Tomcat startup scripts. The scripts use the variables to prepare the command that starts Tomcat.

(3.1) Set CATALINA_HOME (required) and CATALINA_BASE (optional)

The CATALINA_HOME and CATALINA_BASE environment variables are used to specify the location of Apache Tomcat and the location of its active configuration, respectively.

The CATALINA_HOME environment variable should be set as defined in (2.2) above. The Tomcat startup scripts have some logic to set this variable automatically if it is absent (based on the location of the script in Unixes and on the current directory in Windows), but this logic might not work in all circumstances.

The CATALINA_BASE environment variable is optional and is further described in the "Multiple Tomcat Instances" section below. If it is absent, it defaults to be equal to CATALINA_HOME.

(3.2) Set JRE_HOME or JAVA_HOME (required)

The JRE_HOME variable is used to specify location of a JRE that is used to start Tomcat.

The JAVA_HOME variable is used to specify location of a JDK. It is used instead of JRE_HOME.

Using JAVA_HOME provides access to certain additional startup options that are not allowed when JRE_HOME is used.

If both JRE_HOME and JAVA_HOME are specified, JRE_HOME is used.


补充阅读:Tomcat: kick start

关于windows - 使用未配置 JRE_HOME 的 digest.bat 退出创建摘要,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16068916/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com