It is possible. Suppose that [yourclass] is the name of the primary class (the name of the class file you double-click on), and [appname] is what you want for your application. Both are case sensitive. Just follow these steps:
1) enter an empty file named "manifest.mft".
2) write in manifest.mft:
"Manifest Version: 1.0
Main-Class: [yourclass]
Class path :.
"
3) create an empty file called "run.bat"
4) write in run.bat: "java -jar [appname] .jar"
5) first you need to compile your .java file: "javac [file] .java"
6), then you need to pack all the class files and the manifest file into a jar file:
"jar cvfm [appname] .jar manifest.mft * .class"
7) all you have to do is send the [appname] .jar and run.bat that you want, and all they need to do is double-click the run.bat file to launch your program. They must have the JRE installed and the bin foder from the JRE in the Windows PATH system variable.
source share