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.