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
?
Export SubmenuAnt Buildfiles - Generates Ant buildfiles based on the configuration of the Java projects. Archive File - Exports files from the Workbench to an archive file in the local file system. Breakpoints - Exports breakpoints from the workbench to a breakpoint file.
In the JAR File Specification page, select the resources that you want to export in the Select the resources to export field. Select the appropriate checkbox to specify whether you want to Export generated class files and resources or Export Java source files and resources.
Start the Export Wizard from the File-Menu ("File" -> "Export"). Select "+ Fat Jar Exporter" and click "next >". Select the project "demorun" and click "next >". A Configuration-Dialog appears showing the current Settings.
If it is a standalone (Main method) java project then Not any specific path put all the jars inside the project not any specific path then right click on the project - > export - > Runnable jar --> Select the lunch configuration and Library handeling then choose the radio button option "Package required libraries into ...
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:
If you want the JAR to be generated automatically you can look at the following question:
Build project into a JAR automatically in Eclipse
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With