java executable jar creation

前端 未结 5 1869
情话喂你
情话喂你 2021-01-15 04:54

How to Create Executable jar file from .java file. Having only one java file dm.java which created using awt and applet. I need to create executable jar with icon or with im

5条回答
  •  臣服心动
    2021-01-15 05:22

    To do this you have to include file MANFEST.MF into META-INF directory of your jar. The manifest must contain attribute Main-Class. Its value is the fully qualified class name of your main class, i.e. class that is the entry point to your application.

    See http://download.oracle.com/javase/1.4.2/docs/guide/jar/jar.html for details.

    Icon is different. If you are speaking about icon that appears on the left upper corner of your application window use frame.setIconImage(image). If you are asking about the icon that appears on your command window this is platform specific and could be achieved by running script.

提交回复
热议问题