• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Executable jar file problem

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am creating a executable jar MyJar for my application. I am facing some problems
1) My Application contains a properties file MyProperty.properties which contains a key value pair which reference a location of the file
say
CONFIG_FILE=/XML/Test.xml
This MyProperty file and the Test.xml are also included in my jar file.

When I run the executable jar it cannot find the /XML/Test.xml as well as the jar files inside the MyJar.jar. I have included the xerces.jar in MyJar.jar. How should customize my program to find the files and jar
How do I overcome this problem?.

Regards
Thomas
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you accessing the resources inside the jar file? Using the java.io package won't work. This article is a bit applet-centric, but it explains in details how to access files stored in the jar file, and that is applicable to applications as well.
[ May 10, 2006: Message edited by: Ulf Dittmer ]
 
Marshal
Posts: 27364
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have included the xerces.jar in MyJar.jar.

This is also not the right thing to do. You should distribute xerces.jar along with MyJar.jar, not inside it, and you should have MyJar.jar's manifest file include a Class-Path entry that points to xerces.jar. If you haven't already seen it, this tutorial explains the process.
[ May 10, 2006: Message edited by: Paul Clapham ]
 
"How many licks ..." - I think all of this dog's research starts with these words. Tasty tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic