简体   繁体   English

错误:在Netbeans外部运行JavaFX Appl

[英]Error: Running JavaFX Appl outside Netbeans

everyone! 大家!

Here's the thing, I've been developing a JavaFX application with JDK 7u17 (That's the one Netbeans is compilling it, anyways) and I haven't had any problem testing it and running it through Netbeans itself. 事情就是这样,我一直在用JDK 7u17开发JavaFX应用程序 (无论如何,这就是Netbeans对其进行编译),并且通过Netbeans本身测试并运行它没有任何问题。 I simply click Run and it goes smoothly. 我只需单击“运行”,它就会顺利进行。

I'm creating the .jar files and the other (html, jnlp) through Clean-Build using Netbeans and the app does open perfectly when I execute the Jar. 我正在使用Netbeans通过Clean-Build创建.jar文件和其他文件(html,jnlp),并且当我执行Jar时,该应用程序确实可以完美打开。

The problem is when I try to navigate through the App, the app consists of 4 scenes (Login, Main, Search and Create) with me being able to log-in and head to the main scene but that's about it. 问题是当我尝试浏览该应用程序时,该应用程序包含4个场景(登录,主屏幕,搜索和创建),我可以登录并转到主场景,仅此而已。 The buttons to go to the search scene or create scene don't do anything nor I get an error saying something crashed (note I'm not using the console since I don't even know how to make it appear in runtime). 转到搜索场景或创建场景的按钮不执行任何操作,也没有收到提示崩溃的错误消息(请注意,我不使用控制台,因为我什至不知道如何使它出现在运行时)。 I simply click them and they do nothing. 我只单击它们,它们什么也不做。

As I said earlier, the app runs perfectly when it's ran through Netbeans. 正如我之前所说,该应用程序在通过Netbeans运行时可以完美运行。

Some more info: Netbeans Version: 8.0 Compilling Version through Netbeans: 1.7u17 Existing Java versions on System: 1.8u25, 1.7u67 and 1.7u17 (I already tried enabling only 1.7u17) 更多信息:Netbeans版本:8.0通过Netbeans编译版本:1.7u17系统上的现有Java版本:1.8u25、1.7u67和1.7u17(我已经尝试过仅启用1.7u17)

The App used FXML to switch between Scenes, it works great between LogIn and Main scenes. 该应用程序使用FXML在场景之间进行切换,在LogIn和Main场景之间运行良好。

What could it possibly be that it works great using Netbeans and break outside Netbeans? 使用Netbeans并在Netbeans之外打破常规可能会很好?

EDIT #1: According to the console (Thanks to @janih) I'm running Java version 1.7u17, same as Netbeans and it looks like it's working properly. 编辑#1:根据控制台(感谢@janih),我正在运行Java版本1.7u17,与Netbeans相同,并且看起来工作正常。 The problem persists when I'm trying to run the same jar by simply doubli clicking it. 当我尝试通过简单地双击双击运行相同的jar时,问题仍然存在。 It stops showing me controls (Third party controls). 它停止向我显示控件(第三方控件)。

I'm not sure but it could be this: 我不确定,但是可能是这样的:

I was trying to run a project through the given .jar and had those results but that very Project was a plain JavaFX Project, not exactly JavaFX FXML Project and my Project uses FXML files to change between Scenes. 我试图通过给定的.jar运行一个项目,并获得了那些结果,但是那个Project只是一个普通的JavaFX Project,不完全是JavaFX FXML Project,而我的Project使用FXML文件在场景之间进行切换。 What I did is redo the Project in FXML and worked perfectly. 我所做的是重做了FXML中的Project,并且运行良好。

Special thanks to @janih for the help. 特别感谢@janih的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM