How Do I Package and Deploy an Eclipse Java Application?
Asked Answered
P

2

14

I have built a Java application that has some dependencies (~10). I would like to easily package this application up and deploy it as a single file to a CD or USB drive.

There doesn't seem to be any "nice" wizard to search the project, grab the dependencies and setup the classpath on the target computer. I have to do this manually.

Is there a better way? Something simple, easy and straight-forward. A link to a tutorial on this would be great.

Seems to me that this should be a built-in feature to eclipse. Deployment of a web application seems easy enough, but not a Java application.

Pool answered 31/3, 2010 at 18:48 Comment(0)
H
9

Have a look at the Fat Jar Plug-In.

Hellenic answered 31/3, 2010 at 18:50 Comment(1)
Too bad, it doesn't work on Eclipse Luna, I get the following error on install: An error occurred while installing the items session context was:(profile=epp.package.standard, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]net.sf.fjep.fatjar 0.0.31, action=). Failed to prepare partial IU: [R]net.sf.fjep.fatjar 0.0.31.Multidisciplinary
S
4

That's because desktop deployment isn't well defined.

You are heading into release issues which is a huge can of worms.

I assume you have some form of version control like SVN or git? If so check out maven with the release plugin and maven-assembly-plugin

It'll take a lot of work to setup, but once you get it going you'll be cross linking and deploying distribution packages in no time!

Plus you'll have access to the vast maven repos on the web right now

Strontium answered 31/3, 2010 at 18:54 Comment(1)
Believe or not - This project doesn't have source control!!! WTF Right! :) Thanks the advice.Pool

© 2022 - 2024 — McMap. All rights reserved.