问题
I have written a program in java, and I am able to execute it as a jar file. I was wondering two things. one, how would I make the .jar file have a desktop icon other than the standard java icon. and two, I am using netbeans, how would I create a .exe file instead of a .jar file?
回答1:
Like Kitsune said, you can make an executable file. The Java packager I'm most familiar with is Launch4J. It's highly configurable and can be called from Ant scripts, so it can easily integrate into an existing Ant-based build process.
回答2:
If your app. has a GUI and can be distributed from a server, look into Java Web Start.
JWS:
- Is cross platform.
- Can provide icons for desktop shortcuts and menu items.
- Provides the IntegrationService that allows the user to choose what shortcuts they want.
- Is supported by Oracle.
回答3:
You don't If you want an exe with an icon to auto-launch a jar file for you, take a look at WinRun4j.
来源:https://stackoverflow.com/questions/4882043/how-do-i-get-an-icon-on-a-jar-file