I have an application I have written. It is a simple program that has 4 classes that I have written into a single .java file. As expected once compiled I end up with 4 .class files. It runs fine and everything but I have a question. Is there any way I can consolidate those 4 .class files into 1 or at least less than 4 files and still have the app remain runnable? How about making a .jar file? Can you archive the 4 .class files into a .jar and still run the app normally? Also, is there a way to make an app self executable? So that I can put an Icon on Windows desktop and jave a user simply double click it? Thanks. Tom
The answer to all of your questions is the jar format. If you create a manifest file indicating which class contains the main method, you can create a single "executable" jar containing all your files whch you can place on your desktop and click to run. When you install a modern Java SDK or JRE on Windows it sets up the jar filetype to run java -jar file.jar if clicked. Look up the documentation for Jar files and the "jar" command.