- Go to one of the
.java
files in your project's package - Add
public static void main(String[] args) { }
somewhere (will be deleted again later) and save the file - Open the "Run as ..." drop-down menu and choose "Run Configurations"
- Right-click on the "Java Application" item in the list on the left and choose "New"
- Enter a name, usually your project's name
- Choose your project by clicking "Browse ..."
- Choose any of your classes (usually there will only be the one we have edited above) as the "Main class" by clicking "Search ..."
- Save the configuration by clicking "Apply"
- Remove
public static void main(String[] args) { }
from step two again - Right-click your project and choose "Export ..."
- Open section "Java" and choose "Runnable JAR file"
- Choose your new launch configuration and some new file
<YOUR_PROJECT>.jar
as the export destination - Click "Finish" and be prepared to ignore some warnings