java executable jar creation

前端 未结 5 1902
情话喂你
情话喂你 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条回答
  •  Happy的楠姐
    2021-01-15 05:08

    It is possible to use Java Web Start to launch applets free-floating on the desk top. JWS can install desktop shortcuts & menu items for apps., both with icons.

    JWS uses Jar files only. To Jar your applet, do something like..

    prompt>dir
    dm.java
    prompt>javac dm.java             // compile the source
    prompt>dir
    dm.class
    dm$1.class
    dm.java
    prompt>jar -cf *.class dm.jar    // archive the classes
    prompt>dir
    dm.class
    dm$1.class
    dm.jar
    dm.java
    prompt>
    

    It is not strictly necessary to include a manifest in a JWS application, and there is almost no point for a JWS applet. The applet class is instead specified in the JNLP file used to launch the applet. The JNLP file also contains information on the shortcuts and icons.

提交回复
热议问题