1) Create file HelloWorld.java
2) Compile HelloWorld.java (eg : javac Helloworld.java) to HelloWorld.class
3) create a file named manifest.txt
4) Add content "Main-Class: HelloWorld" to manifest.txt file
5) Now run this command on command Prompt ( E:\java\exe>jar -cfm
test.jar manifest.txt
HelloWorld.class)
6) and then command java -jar test.jar or double click test.jar file
2) Compile HelloWorld.java (eg : javac Helloworld.java) to HelloWorld.class
3) create a file named manifest.txt
4) Add content "Main-Class: HelloWorld" to manifest.txt file
5) Now run this command on command Prompt ( E:\java\exe>jar -cfm
test.jar manifest.txt
HelloWorld.class)
6) and then command java -jar test.jar or double click test.jar file
Comments
Post a Comment