0

I am trying to export an individual runnable class from a larger project. This specific class does not depend on the project libraries.

In Export->Java->Runnable JAR file -> Library handling there are options to extract, package or copy the required libraries, but not to simply omit them.

I really don't need them, moreover the library export fails in my situation.

How can I export it without libraries?

sina72
  • 4,931
  • 3
  • 35
  • 36

1 Answers1

2

The far jar plugin supports this.

When you export a java project containing jars using the File -> Export -> Other -> One Jar Exporter, in the Select files for Fat Jar page of the wizard you can choose not to include the libraries like so :

enter image description here

The jar thus exported works fine.

Ashutosh Jindal
  • 18,501
  • 4
  • 62
  • 91
  • Many thanks Ashutosh, upvote +1. Using FatJar works but I had to deselect all jars individually, more than 60 jars in my case. I don't want to do this everytime I export one of my main classes (and I have different ones so I cannot simply save settings), so I am waiting for another answer with a more simple solution. – sina72 Aug 14 '12 at 15:29
  • 1
    Thanks. If you click on the `Save Settings` button, it might save your jar selection. Also, you might want to click on the `Export ANT` to get a build file which will build the fat jar automatically for you and shall preserver you jar selection settings. – Ashutosh Jindal Aug 14 '12 at 15:39
  • `Export ANT` solved it, thanks. In there I was able to remove all library copy commands. Answer accepted. – sina72 Aug 15 '12 at 08:32