A JAR (Java ARchive) is a package file format typically used to aggregate many Java class files and associated metadata and resources (text, images, etc.) into one file for distribution. JAR files are archive files that include a Java-specific manifest file. They are built on the ZIP format and typically have a .jar file extension.
- Create a new Java Project and create a new Package.
- Write the JarFile.java in eclipse.
- Then export the JarFile.java by right click on program and click EXPORT.
- In Java Click on Jar File.
- Give the file name and store path for jar file.
- Click finish.
- Write the Next Java Program (eg. Assignment8.java).
- Execute the program.
JarFile.java
This Video might be Helpful.
package SMD8; public class JarFile { public static void main(String[] args){ int i=10, j=20; Assignment8 A = new Assignment8(); System.out.println("This out is from JarFileSMD8.jar"); System.out.println(A.wc()); System.out.println("Addition: "+(i+j)); } }Assignment8.java
package SMD8; public class Assignment8 { public String wc(){ return "BE - IT 2017 - 18000"; } }
Comments
Post a Comment