调用方法时出错,无法启动jvm [英] Error invoking method, failed to launch jvm
问题描述
我正在使用javafx v8.0.40开发桌面应用程序。我用inno 5创建了一个exe文件。当我在我的计算机上运行exe文件时,它安装并运行没有任何问题。另一方面,当我尝试在其他计算机上安装并运行它时,在安装结束时会弹出窗口对话框:错误调用方法,我单击确定。另一个窗口弹出无法启动jvm。我搜索了整个互联网,但我找不到这个话题。我希望我能解决这个问题。
提前谢谢。
I'm developing a desktop application using javafx v8.0.40. I have created an exe file with inno 5. When I run exe file in my computer, it is installed and run without any problem. On the other hand, when I try to install and run it on some other computer, at the end of installation, window dialog pops up: "Error invoking method", I click Ok. Another window pop up saying "Failed to launch jvm". I searched the whole internet, but I couldn't find much about this topic. I hope I will get solution to this problem. Thank you in advance.
推荐答案
我遇到了同样的问题;以下工作对我有帮助,让我理解那些被抨击的错误调用方法。和无法启动JVM对话框:
I ran into the same problem; the following worked for me and helped me make sense of those blasted "Error invoking method." and "Failed to launch JVM" dialogs:
- 查找
.jar
file
- 它与您的项目具有相同的名称,它位于应用程序的安装目录下
AppData \ Local \ {ApplicationTitle} \ app
(快捷方式:在浏览器中键入%appdata%);如果您的项目名为HelloWorld,那么您将找到HelloWorld.jar
- 它与您的项目具有相同的名称,它位于应用程序的安装目录下
- Find your
.jar
file- It has the same name as your Project and it's in your application's installation directory under
AppData\Local\{ApplicationTitle}\app
(shortcut: type %appdata% into explorer); if your project was named HelloWorld, there you will findHelloWorld.jar
- It has the same name as your Project and it's in your application's installation directory under
- shift + 右键单击在资源管理器窗口中的任何空白处并选择在这里打开命令窗口(这是我最近学到的一个奇特的伎俩; 或者你会
cd
使用命令提示符到同一目录)
- shift+Right Click any blank spot in the Explorer window and choose "Open command window here" (that's a fancy trick I recently learned; alternatively you would
cd
to the same directory using the command prompt)
- 输入
java -jarHelloWorld.jar
并点击输入
- type
java -jar "HelloWorld.jar"
and hit Enter
Tadah! 看看你隐藏的异常(存在错误调用方法。所以模糊地试图与你沟通)。 *
Tadah! Behold your hidden exceptions (the existence of which "Error invoking method." so vaguely tries to communicate to you). *
如果您的问题与我的问题类似,则源自项目 out
文件夹和安装目录之间的文件结构差异,这就是为什么程序在编辑器中编译得很好并且构建得很好 - 直到没有问题为止它是内置的,文件结构有点不同。
If your problem is similar to mine it stems from a file structure difference between the project out
folder and the installation directory, and that's why the program compiles just fine in the editor and builds just fine—there isn't a problem until it's built out, and the file structure is a little different.
*如果在通过命令行运行它时没有得到任何内容,请查找任何错误可能在 initialize()
方法期间发生;那就是你的问题所在。 您可以使用弹出例外对话框在运行时公开任何异常,如类似问题,此处所示。
*If you didn't get anything when you ran it via the command line, look for any errors that could be happening during that initialize()
method; that's where your problem likely is. You can expose any exceptions during runtime by using a Popup Exception Dialog like shown in a similar problem, here.
这篇关于调用方法时出错,无法启动jvm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!