Monday, 5 December 2016

Steps to make the .jar file

Steps to make the .jar file

Step 1: - prepare the .class file by the javac these are the .class file that we want to move in the .jar file.
               C:\java>javac abc.java
.class will be generated.

Step 2: -Execute the jar command
command to make jar file
Step 3: - After creating the sample.jar file just place it in the jre\lib\ext folder.
Step 4: - Delete the .class file from the current directory
Step 5: - Run the program java Test
                                                That contains main method
Step 6: - System class loader becomes fail to load Test.class but extended class loader will load successfully from 
            C:\Program Files\java\jdk1.8.0\jre\bin\ext\sample.jar

No comments:

Post a Comment