On 2006-07-22, bill turner <> wrote:
> lordy wrote:
>>
>> [SNIP]
>>
>> > $JAVA_HOME/bin/java -jar jar/jequire.jar
>>
>> Another attack vector
. Try
>>
>> EITHER
>>
>> putting util.jar in the same directory as your application jar file.
>>
>> OR
>>
>> ensuring that your Manifest Class-Path has the correct relative path
>> from your application jar to util.jar
>>
>> E.g.
>> Class-Path: lib/util.jar (if lib directory is inside 'jar' directory)
>> or
>> Class-Path: ../lib/util.jar (if lib directory is in same directory as
>> your 'jar' directory)
>>
>> If thats the fix - sorry about the wild goose chase 
>>
>> Lordy
>
> Option one does not make sense to me. I do not want to mix my
> executable (application) jar with jars imported into the project.
>
> Option two is what I think I already have. The application (executable)
> jar contains the util jar.
AFAIK you should not have your utils jar inside your main jar. That
sounds more like mixing imported jars than simply having them side by
side in the same directory.
Either have
the files <path>/app.jar <path>/util.jar in you distribution out on the
file system And have "Class-Path: util.jar" in your manifest..
OR (but I havent tried it)
have the files <path>/app.jar and <path>/lib/utils.jar
And have Class-Path: lib/util.jar in your manifest..
But dont embed utils.jar in your main .jar. If you want to put the
util.jar inside you main jar then I think this is worse than having the
two jars in the same directory personally, but I'm not sure if Java can
load your util classes directly. You'd have to read up on it. it makes
it awkward if you want to upgrade your 'utils.jar' at a later point.
Most apps (ant etc) have util jars sitting out on the file system
somewhere, not embedded in their own jar.
When you install your application you should simply have ...
<install-path>/your-app.jar
<install-path>/lib/util.jar
As two separate files.
The Manifest of your main app should then contain Class-Path:lib/util.jar
I suspect.
Lordy