- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试为一些密码创建摘要。
运行以下命令时
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
在后面(有和没有分号和/或尾随反斜杠)但问题仍然存在。
tomcat的版本是7.0.34
java版本为jre7
操作系统为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/
我回到 Windows 上的旧系统(Liferay 5.2 与在 JRE 1.6 上运行的 Tomcat 6 捆绑在一起)进行小调整。我的机器上安装了多个 JRE。我设置了JRE_HOME环境变量,因
当我启动它时。那个时候我得到错误 JRE_HOME environment is not defined properly。我在系统的用户变量上声明了该变量。我仍然收到此错误。 C:\Users\sh
这个问题已经有答案了: Difference between JAVA_HOME and JRE_HOME (1 个回答) 已关闭 6 年前。 在哪种情况下我们选择 JRE_HOME ?如果我没有提到
当我从 Windows 命令提示符运行 start-bamboo.bat 文件时。即使定义了 JRE_HOME,我仍然遇到以下错误。 The JRE_HOME environment variable
在 CentOS 中执行 sudo ./startup.sh 时,出现以下错误: "Neither the JAVA_HOME nor the JRE_HOME environment variabl
我尝试启动 apache tomcat 服务器,但出现类似JRE_Variable 变量未正确定义 的错误,但我尝试在系统变量和用户变量中定义变量,但没有用错误。 我在哪里定义变量系统变量或用户变量?
我有一个启动 Tomcat 的脚本,它看起来像这样: rem set JRE_HOME=C:\Program Files\Java\jdk1.7.0_03 set JRE_HOME=C:\Progra
最近我在 tomcat 中运行一个基本的 web 应用程序时遇到了一个错误。错误是“类已由更新版本的 Java 环境编译”。我使用的是jdk-11.0.2和jre1.8.0_201。然后我遇到了thi
我正在运行 ubuntu,而 djatoka(在 tomcat 中运行)无法与 OpenJDK 一起使用。因此,我将 JAVA_HOME 和 JRE_HOME 设置为我下载并导出变量的 Sun jav
我使用 sudo apt-get open-jdk7 在我的 Ubuntu 操作系统上安装 Java。 当我打开终端并键入 echo $JRE_HOME 时,它什么也不显示。但随后我执行 java -
当我尝试使用 startup.bat 运行 tomcat 时,出现以下错误, The JRE_HOME environment variable is not defined correctly Th
尝试从 pip 安装 jnius(这是 pip install sikuli 的要求)。 这是我在尝试安装时遇到的错误: 是否正确定义了变量? 有谁明白为什么它一直说找不到JRE_HOME? 编辑:我
我已经分配了一个 Linux 盒子,其中有可用的 java # java -version java version "1.7.0_09-icedtea" OpenJDK Runtime Enviro
两周前我安装了 tomcat 和 Apache http 服务器。我让它运行起来,并且能够从另一台计算机上运行 JSP 页面。我稍作停顿,现在我正在尝试运行它不起作用的系统。 我可以访问 中的默认索引
当我尝试将 Tomcat 安装为服务时,我不断收到 "JAVA_HOME environment variable is not defined" 错误,即使我的 Java_Home 设置为我的 jr
我正在尝试为一些密码创建摘要。 运行以下命令时 C:\Program Files\apache-tomcat-7.0.34\bin> digest.bat -a SHA-256 somepasswor
我是 Tomcat 的新手。我的 ubuntu 10.10 上的 Tomcat 7 有问题。 当我这样启动Tomcat时 llchli@llchli-virtual-machine:/usr/loca
我正在尝试使用 tomcat 9.0 部署 Web 应用程序。我遇到以下错误: Neither the JAVA_HOME nor the JRE_HOME environment variable
我在设置 Tomcat 和 Java 环境路径时遇到了这个错误: Neither the JAVA_HOME nor the JRE_HOME environmental variables is d
如果我想在 linux 平台上编译/运行或只是运行 Java 应用程序,是否需要所有三个环境变量? JAVA_HOME export JAVA_HOME=/opt/jdk1.7.0_75 JRE_
我是一名优秀的程序员,十分优秀!