25
loading...
This website collects cookies to deliver better user experience
Java class files
and associated metadata and resources (text, images, etc.) into one file to distribute application software or libraries on the Java platform frames
, panel present inside the main method, that would also be executed.If you want to learn more about VsCode and other text editors you can go through this Blogpost
JAVA PROJECTS
there you will find and symbol saying EXPORT JAR
. Click itmain class
just provide the main class ,here MyCalc
NOTE:-Otherwise the jar file will become, normal jarfile not an executable ones
switches
with which we can create an executable jarfilejavac
from the command line:javac MyCalc.java
javac
command creates MyCalc.class
in the current directory. If you have multiple java file compile them too, We can now package that into a jar file.MyCalc
) then press enter.NOTE:It's important that we end our manifest file with a newline.Otherwise no main manifest attribute error is thrown.
manifest.MF
Open the Command Prompt, write the command using jar tool switches provided
using jar
command
jar -cvfm <jarfilename.jar> <manifestfile> <classname.class>
jar
command to create a jar file.c
used to indicates we are creating new filev
generates verbose output informationf
tell about the jarfile name we are creating m
it includes the manifest information-jar
option of the java command to run our application since executable jarfile has been created.java -jar CALC.jar
CALC.jar
you can find here