简体   繁体   中英

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. 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. 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.
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...

if you're able to execute the jar correctly from the terminal then it's the launching command that is the problem. 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. You may have to update your system file associations to make sure it's java that is launching your .jar files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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