0

How I did the export:

  1. select the project
  2. right click > export...
  3. Runnable JAR file

The problem:

The jar somehow misses folders in the project that is not under the src/.

I tried exporting as a regular Jar, in which I can select what files to be included. But after some searching, it seems there is no way to auto include dependencies not directly in the project (I'm using Maven and another external lib added by an eclipse plugin).

The "runnable jar" export apparently uses a launch profile to create the jar. I tried to tinker with the launch profile, but was unable to a setting to specify needed files/folders in the project for run.

I found a few articles about using Maven directly, with pom's maven-assembly-plugin to pack the jar without Eclipse. I did a quick digging, and it seems that's a bit raw. If it could be done directly in eclipse, that'd be great.

Vin
  • 559
  • 2
  • 18
  • have you selected the additional folders e.g resources etc.. in the export dialog ? – unique_ptr Aug 10 '15 at 15:45
  • There is no options to select files in "Runnable Jar" export. You can select files in the normal jar export, but, as I said, you can't auto add dependencies. – Vin Aug 10 '15 at 17:29
  • Do you use maven in your project ? – unique_ptr Aug 10 '15 at 20:48
  • yes. and i use gwt libs managed by google eclipse plugin. – Vin Aug 11 '15 at 00:12
  • see this http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven – unique_ptr Aug 11 '15 at 08:47
  • As I said in my question, I found a few sites about using Maven directly, incl. the link you listed. I spent a few minutes on that and didn't figure out how to make it work with my needs. I'm quite interested in learning a way directly in Eclipse if possible. otherwise I may turn to the link you mentioned, and probably gradle. – Vin Aug 11 '15 at 12:43
  • 1
    ok then try this `rightclick on the project -> build path -> configure build path -> order and export` then select your folder and reexport – unique_ptr Aug 11 '15 at 12:54
  • Ah, thanks Riadh for the pointer. The key is in the "order and export" dialog but it's not simply ticking the folder -- the folder is not shown here at all. I figured out that I should convert this folder to a source folder, so that it shows up here, and selecting it will keep it finally in the runnable jar. – Vin Aug 11 '15 at 15:39

0 Answers0