Put a Java app in the Dock on Mac OS X

浪尽此生 提交于 2019-12-11 04:48:45

问题


I've created an app in java and I would like to be able to put it in the dock on Mac OS X. It's not possible to do it with the .jar file, so I've wrapped it in an .app folder. Now it won't even start.

The app creates files in the same directory as the MyApplication.jar file and I thought this might be the problem. Can you write files in the MyApplication.app directory? If not, what might be causing this problem?


回答1:


You may be missing the JavaApplicationStub or some critical element in your Info.plist. If these terms are unfamiliar, several related developer links are cited here. Technically, you can write to $JAVAROOT if you have permission, but the preferred approach is to use a directory available to the user, as discussed in the guidelines cited here.




回答2:


I finally did it using Eclipse. There's a export as a Mac bundle option in the file menu in the Mac OS X version of Eclipse :)



来源:https://stackoverflow.com/questions/17054293/put-a-java-app-in-the-dock-on-mac-os-x

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!