Passing system properties by default to java task

Al Le <[email protected]>
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <[email protected]>
Hello,

I'd need an advice from the experts.

In my ant script, I run a java program several times (up to 20) via the 
'java' task. The program opens a connection to some server and uses the 
IAIK library for this (some Java security stuff).

The server requires a certain level of the security mechanism to be used 
by the client which (the level) is NOT used by default. To force the 
correct security level, one should specify some system properties when 
calling the program (IIUC, the properties are interpreted by the IAIK 
library).

If the java task is executed in the ant's JVM, i.e. if the 'fork' option 
is set to 'false', then I can specify those options when starting ant, 
and they are also visible to the program executed via 'java'.

But since the program has caused some memory problems, I have to execute 
it each time in a new JVM which is discarded after each run so that the 
memory problems do not accumulate.

When starting 'java' with the 'fork=true' option, the system properties 
of the ant's JVM don't get passed to the JVM started by 'java' so that I 
have to explicitly specify them using nested 'sysproperty' elements.

This I don't like because I think that this belongs to the 'environment' 
and should not be explicitly present in the script.

How can I achieve that some system properties are passed to the JVM 
started by the 'java' task with the 'fork=true' option without 
specifying them explicitly in the script?

Thank you for any hints!

AL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.