[Java] Java package and batch execution

xiaoxiao2021-03-06  119

Compiled good projects, can be packaged and executed under Windows: Import java.awt. *; import java.awt.event. *; import javax.swing. *;

public class Frame1 {public static void main (String [] args) {JFrame frame = new JFrame (); frame.addWindowListener (new WindowAdapter () {public void windowClosing (WindowEvent e) {System.exit (0);}}) Frame.SetVisible (TRUE);}} 3, set the manifest.mf file, put it in directory: $ / proj / manifest.mfmain-class: snake.main4, set batch file, first compile, then package, then Run, put it in the directory $/prouj/play.bat@echo offjavac snake / *. Java jar cvfm snake.jar manifest.mf snakejava -jar snake.jar@echo on Welcome to:

转载请注明原文地址:https://www.9cbs.com/read-100968.html

New Post(0)