Create a jar/exe file in java using cmd

 Yes, obviously why would someone create a jar file using console. When instead they could use an IDE. well, You would do it. That is why you are here. so, lets get started.

import javax.swing.JFrame;
import javax.swing.JLabel;public class TempSwing
{
public static void main(String args[])
{
JFrame frame = new JFrame();
frame.setTitle("Create Account");
JLabel G1 = new JLabel("Hello World!");
frame.setSize(500,700);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(G1);
frame.setVisible(true);
}
}
jar -cfe Temp.jar TempSwing "."

Comments

Popular posts from this blog

26th September - Day 15 of writing Diary

Day 2 of writing Diary

6th October Day 25 of writing Diary