gpt4 book ai didi

java - 使用 JRockit 安装 Tomcat 失败

转载 作者:行者123 更新时间:2023-11-28 22:52:51 25 4
gpt4 key购买 nike

我无法在 Windows Server 2008 上安装 Tomcat 使用apache-tomcat-7.0.67.exe 与 JRockit jvm。我能够安装tomcat与oracle jvm完美结合。然后我选择了"C:\Program Files (x86)\Java\jrockit-jdk1.6.0_45-R28.2.7-4.1.0\jre\bin" jre.it 的路径显示一条消息说 “找不到 Java 虚拟机
文件夹”
并且 tomcat 安装程序退出。

最佳答案

来自 https://svn.apache.org/repos/asf/tomcat/tc8.0.x/trunk/res/tomcat.nsi :

${If} $JavaHome == ""
${OrIfNot} ${FileExists} "$JavaHome\bin\java.exe"
IfSilent +2
MessageBox MB_OK|MB_ICONSTOP "No Java Virtual Machine found in folder:$\r$\n$JavaHome"
DetailPrint "No Java Virtual Machine found in folder:$\r$\n$JavaHome"
Quit
${EndIf}

StrCpy "$JavaExe" "$JavaHome\bin\java.exe"

; Need path to jvm.dll to configure the service - uses $JavaHome
Call findJVMPath
Pop $5
${If} $5 == ""
IfSilent +2
MessageBox MB_OK|MB_ICONSTOP "No Java Virtual Machine found in folder:$\r$\n$5"
DetailPrint "No Java Virtual Machine found in folder:$\r$\n$5"
Quit
${EndIf}

...

; ====================
; FindJVMPath Function
; ====================
;
; Find the full JVM path, and put the result on top of the stack
; Implicit argument: $JavaHome
; Will return an empty string if the path cannot be determined
;
Function findJVMPath

ClearErrors

;Step one: Is this a JRE path (Program Files\Java\XXX)
StrCpy $1 "$JavaHome"

StrCpy $2 "$1\bin\hotspot\jvm.dll"
IfFileExists "$2" FoundJvmDll
StrCpy $2 "$1\bin\server\jvm.dll"
IfFileExists "$2" FoundJvmDll
StrCpy $2 "$1\bin\client\jvm.dll"
IfFileExists "$2" FoundJvmDll
StrCpy $2 "$1\bin\classic\jvm.dll"
IfFileExists "$2" FoundJvmDll

;Step two: Is this a JDK path (Program Files\XXX\jre)
StrCpy $1 "$JavaHome\jre"

StrCpy $2 "$1\bin\hotspot\jvm.dll"
IfFileExists "$2" FoundJvmDll
StrCpy $2 "$1\bin\server\jvm.dll"
IfFileExists "$2" FoundJvmDll
StrCpy $2 "$1\bin\client\jvm.dll"
IfFileExists "$2" FoundJvmDll
StrCpy $2 "$1\bin\classic\jvm.dll"
IfFileExists "$2" FoundJvmDll

ClearErrors
;Step tree: Read defaults from registry

ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$1" "RuntimeLib"

IfErrors 0 FoundJvmDll
StrCpy $2 ""

FoundJvmDll:
ClearErrors

; Put the result in the stack
Push $2

FunctionEnd

我读这篇文章的方式是,您的 JRE 中需要有一个 bin\java.exe,同时在列出的子目录之一中有一个 jvm.dll。

尝试将“C:\Program Files (x86)\Java\jrockit-jdk1.6.0_45-R28.2.7-4.1.0\”指定为根。

关于java - 使用 JRockit 安装 Tomcat 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35061143/

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