How can I compile a Java program in Eclipse without running it?
Solution 1:
You can un-check the build automatically in Project menu and then build by hand by type Ctrl + B, or clicking an icon the appears to the right of the printer icon.
Solution 2:
You will need to go to Project->Clean...,then build your project. This will work, even when your source code does not contain any main method to run as an executable program. The .class files will appear in the bin folder of your project, in your workspace.
Solution 3:
Right click on Yourproject(in project Explorer)-->Build Project
It will compile all files in your project and updates your build folder, all without running.