javafx本机包错误调用方法 [英] javafx native package error invoking method

查看:31
本文介绍了javafx本机包错误调用方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 javafx v8.0.60 开发桌面应用程序.我在netbeans 8 中用ant 创建了一个exe 包.当我在我的电脑中运行exe 文件时,它被安装并运行,没有任何问题.

I'm developing a desktop application using javafx v8.0.60. I have created an exe package with ant in netbeans 8. 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:

调用方法出错"

我点击确定.另一个窗口弹出说:

I click Ok. Another window pop up saying:

无法启动 jvm"

推荐答案

Davood,您好!我遇到了同样的问题,我和你一样,在任何地方都找不到帮助.

Davood, greetings! I had this same problem and I, like you, found no help anywhere.

我向您提交了一个解决方案,该解决方案奇迹般地对我有用,并帮助我理解了那些该死的错误调用方法".和无法启动 JVM"对话框:

I submit to you a solution, which miraculously worked for me and helped me make sense of those blasted "Error invoking method." and "Failed to launch JVM" dialogs:

  1. 找到您的 .jar 文件
    • 它与您的项目同名,并且位于 AppData\Local\{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 AppData\Local\{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.

这篇关于javafx本机包错误调用方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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