Reputation: 123
So this may seem a bit vague, how quick is "quick" etc.
Well I'm just wondering if there is a way of exporting a JAR file in a quicker way than:
File -> Export -> JAR File
etc etc.
Like can I Ctrl + Drag
to explorer and it export with the project title and .jar
?
Upvotes: 6
Views: 4949
Reputation: 26004
To add or change shortcuts open: Windows->Preferences->General->Keys. Here you can find all the Eclipse commands and their associated shortcut keys.
You can add a custom binding in eclipse to export your jar using a keyboard shortcut.
Example
I added bindings both for Runnable and non-runnable jar:
If you want the JAR to be generated automatically you can look at the following question:
You can use the combination of the following two answers:
Basically create a batch file that makes the JAR... add a button that executes it.
Upvotes: 8
Reputation: 1065
If using Maven a long term option would be to set up your build to 'package' your jar. Then just run the mvn package command from the command line or using the Eclipse Maven plugin. This method requires some upfront work, but it buys you a consistent and easy jar export.
Upvotes: 2