简体   繁体   English

没有cmd的运行jar

[英]Running jar without cmd

How is running a jar file from terminal different from running it directly?? 从终端运行jar文件与直接运行jar文件有何不同?

What I want to ask is, I made a GUI application and added a launcher icon to it. 我想问的是,我制作了一个GUI应用程序,并向其中添加了启动器图标。 When I run it from terminal, it shows the launcher icon and I can as obvious lock that icon to the launcher. 当我从终端运行它时,它会显示启动器图标,并且可以很明显地将该图标锁定到启动器。 But, when I run it directly, it shows the default jvm icon instead of the launcher icon I added. 但是,当我直接运行它时,它将显示默认的jvm图标,而不是我添加的启动器图标。 And, if I lock that icon to the launcher, and try to run the app by clicking the icon, it just doesn't do anything?? 而且,如果我将该图标锁定在启动器上,并尝试通过单击该图标来运行该应用程序,那么它什么也没做?

Is their any way, that it shows the same launcher icon I added to it?? 无论如何,它显示的是我添加到其中的相同启动器图标吗?

You need to set the dock icon in OSX for this to work. 您需要在OSX中设置停靠图标才能起作用。

Possible duplicate of the question : How do you change the Dock Icon of a Java program? 问题的可能重复部分: 如何更改Java程序的Dock图标?

Additionally, refer this documentation : https://developer.apple.com/library/mac/documentation/Java/Conceptual/Java14Development/00-Intro/JavaDevelopment.html 此外,请参阅以下文档: https : //developer.apple.com/library/mac/documentation/Java/Conceptual/Java14Development/00-Intro/JavaDevelopment.html

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

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