java - 使用 JRockit 安装 Tomcat 失败

标签 java tomcat jrockit

我无法在 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/

相关文章:

java - 在 JUnit 中记录导致错误的数据的推荐方法是什么?

java - Java 字节数组转十进制

java - URLClassloader 依赖项

jsp - javax.命名.NamingException : Could not create resource factory instance

concurrency - 分析 OpenJDK 或任何 Java VM 中的锁

java - 基于选择的 AuthProvider Spring Security

oracle - 将 JDBCRealm 从 tomcat 移植到 OC4J

java - Java/Tomcat 中的异步方法

java - 下载 JRockit 5 jre

java - 无法在具有 8GB RAM 的系统上将 xmx 设置为超过 4GB