#16 Resources should get added to jar file

closed
COLLECT (2)
5
2007-09-29
2007-02-16
Anonymous
No

Say I have pictures etc in the eclipse directory that my program needs... Then, fat jar should get them too!
smitra@iastate.edu

Discussion

  • Ferenc Hechler
    Ferenc Hechler
    2007-02-27

    Logged In: YES
    user_id=876063
    Originator: NO

    If the resources are on the classpath they will be packaged automatically.

    If they are not, they can be added manually using the file-select dialog ("add..." Button). This option does not work well when using the one-jar feature.

    Most problems occur from accessing the files as resources.
    You can look at the help forum how to access the resources.

    Best regards,

    feri

     
  • Logged In: NO

    Also .dll files that are in the project directory should be added - this is very important.

     
  • Ferenc Hechler
    Ferenc Hechler
    2007-03-06

    Logged In: YES
    user_id=876063
    Originator: NO

    to add the directory of the jar file to the classpath to access resources on the same level, just add "." to the Class-Path input-field in the Fat-Jar Wizard Configuration Page.
    You may add more dirs separated by spaces: ". conf/".
    Also extern libs can be added this way: ". conf/ lib/externlib.jar"
    It is not possible to add jni libs (DLLs) via the jar-manifest. This must be done explicitly by the java command "java -Djava.library.path=... ".
    If the DLL resides in the same folder as the executable jar I think it is automatically recognized. You may take a look at the SWT-FAQ: http://fjep.sourceforge.net/fjepfaq.html

    Best regards,

    feri

     
  • Ferenc Hechler
    Ferenc Hechler
    2007-09-29

    • status: open --> closed