''''没有'服务器'JVM [英] No 'server' JVM at '...'

查看:128
本文介绍了''''没有'服务器'JVM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个我们作为服务器端系统分发的java应用程序。我正在尝试编写一个启动器(写在这里有点夸大其词,我基本上只是复制Java.exe文件,以便我们可以在windows的进程浏览器中获得所需的名称)。这个exe在我们的应用程序文件树的bin /目录中。

I'm running a java application that we distribute as a server-side system. I'm trying to write a launcher ("write" is somewhat of an overstatement here, I'm basically just copying the Java.exe file so that we can get the desired name in the process explorer of windows). This exe is in our bin/ directory of our application file tree.

现在,我们的文件树中还有一个jre /目录,这是Java.exe实际驻留的地方(我们的产品随Java环境一起提供)。当我使用Java.exe作为启动器,它位于\ jre \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\工作得很好。但是,如果我将'Orange.exe'放在bin \目录中,那么我会收到以下错误:

Now, we also have a jre/ directory in our file tree, which is where Java.exe actually resides (we ship our product with the Java environment). When I use Java.exe as the launcher, which is located in \jre\jre1.6.0_21\bin, or if I place the copy (call this exectuable 'Orange.exe') I made in this directory, it works just fine. But, if I put my 'Orange.exe' in the bin\ directory, then I get the following error:

错误:没有'服务器'JVM at'C:\Program Files\Java\jre6\bin\server\jvm.dll'

我想我明白这里发生了什么 - 我想使用jvm.dll文件的服务器版本,它位于我们的jre目录中。问题是,我不明白为什么它不在我的应用程序路径中的jre\jre1.6.0_21目录中查找。我已将JAVA_HOME环境变量设置为此位置。它似乎违反了另一个系统范围的预期位置。

I think I understand what is happening here - I want to use the server version of the jvm.dll file, which is in our jre directory. The problem is, I don't understand WHY it doesn't look in the jre\jre1.6.0_21 directory in my application path. I've set my JAVA_HOME environment variable to this location. It seems like it's defaulting to another, system-wide expected location.

有谁知道如何更改它,以便它在我的应用程序提供的java环境目录中查找?理想情况下,这将是一个环境变量,因为我需要使用批处理文件使用参数调用此应用程序。

Does anyone know how I can change this, so that it looks in my application-provided java environment directory? Ideally, this will be an environment variable, as I need to call this application with parameters using a batch file.

推荐答案

启动并运行服务器JVM的一个小技巧:

There is a little trick to get the server JVM up and running:


  1. 从JDK的JRE的bin文件夹示例中复制server文件夹: C:\Program Files\Java\jdk1.6.0\jre\bin\server

  2. 粘贴server文件夹到JRE的bin文件夹示例: C:\Program Files \ Java * \\ jre1.6.0 \ bin

  3. 完成

见官方自述文件了解详情。

这篇关于''''没有'服务器'JVM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆