• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Problem with packaging using ant

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.
I have the following structure:
Dir\src for source
Dir\build for class files
Dir\dist for storing the jar
Dir\images images used by the application
using ant, I want to create an executable jar file.
I wrote :

but the problem is, ant doesn't create images directory inside the Jar file, so the application will not working.
(when extracting the jar I found:
com/*.class
Meta-INF
image1.gif
image2.gif)
how to create the images directory inside the jar ??
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to include your "images" directory as part of the build. Right now you are just including all the files inside the "images" directory. Try something like this:

That should work for you if your "images" property is the value you want to show up in your JAR. If you need a different name, you'd have to do something like copy all your images to a temp directory whose name is the one you want, then do the same sort of thing.
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please look at my build file:

now, the jar doesn't include the the images at all !!
how to create the images directory inside the jar ?
please help ....
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The nested include inside the fileset needs to be a relative URI. Since you have your "basedir" portion of your images attribute it messes everything up. Change to this:
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks you alot.
but there is the last problem.
I have the class Manager under the package com, and as you see I have specified it within the manifest tag:
<attribute name="Main-Class" value="com.Manager"/>
but the jar file don't launch (it launch if I put my class without a package)....
so what is the problem ?
I appreciate your help...
 
Are you here to take over the surface world? Because this tiny ad will stop you!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic