没有“服务器”; JVM 在“...”
我正在运行一个java应用程序,我们将其作为服务器端系统分发。我正在尝试编写一个启动器(“写”在这里有点夸张,我基本上只是复制Java.exe文件,以便我们可以在Windows的进程资源管理器中获得所需的名称)。该 exe 位于应用程序文件树的 bin/ 目录中。
现在,我们的文件树中还有一个 jre/ 目录,这是 Java.exe 实际驻留的位置(我们随 Java 环境一起提供产品)。当我使用 Java.exe 作为启动器(位于 \jre\jre1.6.0_21\bin 中)时,或者如果我将我制作的副本(称为可执行文件“Orange.exe”)放置在该目录中,它就可以正常工作。但是,如果我将“Orange.exe”放在 bin\ 目录中,则会出现以下错误:
Error: no 'server' JVM at 'C:\Program Files\Java\jre6\bin\server\ jvm.dll'
我想我明白这里发生了什么 - 我想使用 jvm.dll 文件的服务器版本,该文件位于我们的 jre 目录中。问题是,我不明白为什么它不在我的应用程序路径中的 jre\jre1.6.0_21 目录中查找。我已将 JAVA_HOME 环境变量设置为此位置。它似乎默认到另一个系统范围内的预期位置。
有谁知道我如何更改它,以便它在我的应用程序提供的 java 环境目录中查找?理想情况下,这将是一个环境变量,因为我需要使用批处理文件使用参数调用此应用程序。
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.
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:
Error: no 'server' JVM at 'C:\Program Files\Java\jre6\bin\server\jvm.dll'
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.
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
有一个小技巧可以让服务器 JVM 启动并运行:
C:\Program Files\Java\jdk1.6.0\jre\bin\server
C:\Program Files\Java\jre1.6.0\bin
请参阅官方 自述文件了解详细信息。
There is a little trick to get the server JVM up and running:
C:\Program Files\Java\jdk1.6.0\jre\bin\server
C:\Program Files\Java\jre1.6.0\bin
See official readme for details.
我刚刚在 Eclipse 中遇到了同样的问题,我注意到,正如上面的答案所建议的 JBoss 站点有一个关于此问题的线程,其内容与上面的答案相同,将文件从 jdk 复制到 jre 文件夹。
我注意到,如果您在创建服务器时将运行时定义为 jdk,则可以避免这样做。但我没有找到如何编辑现有服务器。
I've just been struggling with this same problem in Eclipse and I noted that as suggested by the answer above the JBoss site has a thread on this issue saying the same as the answer above to copy files from the jdk to the jre folder.
I noticed that you can avoid having to do this if you define the runtime to be the jdk when you create the server. I didn't find how to edit an existing server though.
AFAIK,JRE 通常不附带服务器 VM(仅附带客户端 VM)。如果您确实需要服务器VM,则必须使用JDK安装。
有关带有服务器 VM 的 JRE,请参阅 Oracle Java for Developers 下载 页面。
AFAIK, the JRE usually doesn't ship with a server VM (only the client VM). If you really need the server VM, you have to use the JDK installation.
See Oracle Java for Developers Download page for JRE's with Server VM.
我在这里遇到了同样的问题,但就我而言,我只是没有正确更新 JAVA_HOME 和我最近安装的 JDK 的 PATH。
我刚刚将其更新到新的 JDK 位置,服务器启动得很好。
I had the same problem here but, in my case, I just had not properly update the JAVA_HOME and my PATH for my recently installed JDK.
I just updated it to my new JDK location and the server started just fine.
Windows 在 LIBPATH 环境变量中查找 DLL。
并确保您的 1.6.0_21 位于 PATH 中的第一个位置。
Windows looks for DLLs in LIBPATH environment variable.
And make sure your 1.6.0_21 is somewhere first in PATH.
我通过将 JAVA_HOME 路径设置为
C:\Program Files (x86)\Java\jre1.8.0_131\bin
解决了同样的问题I solved the same problem by setting the JAVA_HOME path to
C:\Program Files (x86)\Java\jre1.8.0_131\bin
最简单的修复方法是将 bin 内的 client 文件夹的内容复制到 bin 内新创建的文件夹“server”中。
从 C:\Program Files (x86)\Java\jre1.8.0_261\bin\client 复制
粘贴到 C:\Program Files (x86)\Java\jre1.8.0_261\bin\server
*server 是新文件夹
The easiest fix is simply to copy the contents of client folder inside bin and put in a newly created folder 'server' inside bin.
Copy from C:\Program Files (x86)\Java\jre1.8.0_261\bin\client
Paste in C:\Program Files (x86)\Java\jre1.8.0_261\bin\server
*server is the new folder
当我们尝试运行 servicemix 等服务器时,请确保 server/jvm.dll 文件必须存在。
从 JDK 的 JRE 的 bin 文件夹示例复制“server”文件夹:C:\Program Files\Java\ jdk1.6.0\jre\bin\server
将“server”文件夹粘贴到 JRE 的 bin 文件夹示例:C:\Program Files\Java\jre1.6.0\bin
我解决了问题,我经历了上面的问题..工作正常。
谢谢!
Make sure that server/jvm.dll file must be there when we are trying to run servers like servicemix.
Copy "server" folder from the JDK's JRE's bin folder example: C:\Program Files\Java\jdk1.6.0\jre\bin\server
Paste the "server" folder to JRE's bin folder example: C:\Program Files\Java\jre1.6.0\bin
I paced problem, I went through above..That's working fine.
Thanks!