Symlink Jar with Classpath based deployment causing issues

Hi,

I'm trying to deploy a fairly complex code base in a reliable manner onto a system using Ant which allows Rollback functionality in the event of a failure.

I have a pair of directories;

/var/distributions/

/var/www/lib/java/

using symlinks to do the following:

/var/www/lib/java/CORE.jar -> /var/distributions/CORE_1.203.jar

this provides a means to rollback without needing to alter any configuration files, as all that needs changing is the symlink to point at a different core version.

However, Java is stupid.

calling java -jar /var/www/lib/java/CORE.jar

results in a failure to find the lib folder contained within /java/ as the manifest file within Core points in a relative manner to ./lib/, which java interprets as relative to the distributions folder rather than the java folder being executed from. I do not wish to have the lib folder in the distributions folder as this makes no sence, and ideally want the lib to be kept in

/var/www/lib/java/lib

with the classpath pointing to this folder. However, java -jar X -cp Y is useless as Suns wisdom back in 1.3 was "people may use -cp without realising it doesnt work and so we wont make it work incase it breaks their code".

So... my questions are:

1) is there a way of using sym links to have external jars being called whos MANIFEST.MF is relative to the JVMs start directory

2) is there a way of making a MANIFEST.MF use a runtime supplied Classpath

3) is there a way of forcing java to use the path running from and not the symlinked dir

Please help, this is driving me mad

Warmfusion

[1669 byte] By [Warmfusiona] at [2007-11-27 10:55:34]
# 1

>However, Java is stupid.

No. See http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html

You can:

1- use java -classpath to include any jar you want.

2- put your jars into JDK_DIRECTORY/jre/lib/ext/

3- add Class-Path entry to your manifest file (see link above)

hth

java_2006a at 2007-7-29 11:57:21 > top of Java-index,Desktop,Deploying...