调用方法出错,无法启动jvm [英] Error invoking method, failed to launch jvm

查看:26
本文介绍了调用方法出错,无法启动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:

  1. 找到您的 .jar 文件
    • 它与您的项目同名,位于AppDataLocal{ApplicationTitle}app 下的应用程序安装目录中(快捷方式:在资源管理器中键入 %appdata%);如果你的项目名为 HelloWorld,你会在那里找到 HelloWorld.jar
  1. Find your .jar file
    • It has the same name as your Project and it's in your application's installation directory under AppDataLocal{ApplicationTitle}app (shortcut: type %appdata% into explorer); if your project was named HelloWorld, there you will find HelloWorld.jar
  • 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 -jar "HelloWorld.jar" 并点击 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屋!

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