简体   繁体   English

JavaFx jar文件无法通过双击打开相应的文件(Mac)

[英]JavaFx jar file does not open corrent with double click (Mac)

I have quite big problem, which drives me crazy. 我有一个很大的问题,这使我发疯。 Not sure what is the best way to describe my problem, so I am just going to write what I do and what happens: 不确定描述我的问题的最好方法是什么,所以我将要写我所做的事情和发生的事情:
I am using NetBeans. 我正在使用NetBeans。 I just right click on a project I have and click on clean and build. 我只是右键单击一个已有的项目,然后单击“清理并构建”。 Everythings goes right. 一切顺利。 But here is the problem. 但这是问题所在。 When I go to dist, where .jar file was deployed and double click on it, it does not open as it should. 当我进入dist时,在其中部署了.jar文件并双击它,它没有按应有的方式打开。 All view is something like zoomed in and it does not change. 所有视图都是类似放大的,并且不会改变。 I know that button is supposed to be on the right at the bottom (although I cannot see it there, I just see text here, which is suppost to be on the top) and if I click there, it executes and it does what it supposted to do... Another interesting thing is that if I open exact the same .jar file through terminal it opens just perfectly fine as it should. 我知道该按钮应该在底部的右侧(尽管我看不到它,但我只是在这里看到文本,该文本位于顶部),如果我单击该按钮,它将执行并执行该操作禁止这样做...另一个有趣的事情是,如果我通过终端打开完全相同的.jar文件,则可以正常打开。
I am asking for an advase what should I do, as I am not sure anymore. 我正在问一个建议我该怎么办,因为我不确定。 I have deleted JDK and reinstalled it, I even reinstalled netbeans... 我删除了JDK并重新安装了它,甚至重新安装了netbeans ...

if you're able to execute the jar correctly from the terminal then it's the launching command that is the problem. 如果您能够从终端正确执行jar,则问题在于启动命令。 Try creating a "shortcut" (or a script, whatever the equivalent is in Mac) that actually executes "java -jar myjar.jar" and do your "double click" start through that. 尝试创建一个实际上执行“ java -jar myjar.jar”的“快捷方式”(或脚本,在Mac中是等效的脚本),然后从中开始“双击”。 You may have to update your system file associations to make sure it's java that is launching your .jar files. 您可能需要更新系统文件关联,以确保启动您的.jar文件的是Java。

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

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