Eclipse: Is there a way to quickly export JARs

eclipse, jar, java

Solution

How to add custom shortcuts

To add or change shortcuts open: Windows->Preferences->General->Keys. Here you can find all the Eclipse commands and their associated shortcut keys.

Reference

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:

- Export Jar: CTRL+SHIFT+J

- Export Runnable Jar: CTRL+SHIFT+R

How to do with Ant File

If you want the JAR to be generated automatically you can look at the following question:

Build project into a JAR automatically in Eclipse

How to do with Batch file run from Button

You can use the combination of the following two answers:

- Create jar file from command line

- In Eclipse, how can I add a toolbar button to run a batch file?

Basically create a batch file that makes the JAR... add a button that executes it.

Problem

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`?

Original source

Related problems