ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Al Le <>
Subject Passing system properties by default to java task
Date Thu, 17 Aug 2017 21:25:07 GMT

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 

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!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message