[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] JVM System Parameters!!





Michael Remijan wrote:

If I am running a Java universe job, what can I use in my submit file to pass along Java system parameters? When running a Java application, JVM system parameters look like this:

/usr/bin/java -DMyJVMParam1=Ni-DMyJVMParam2=Spam .....

There's no good way to do this in Condor today. In the config file, you can set the java VM command-line arguments, but that's for all java
invocations for a given startd, which is probably not what you want.


Probably the best way to do this today is to write a small Java
wrapper which reads -Dprop1=val1 style property settings from the leading command-line arguments, calls System.setProperties() itself, then uses reflection to invoke your real main class and args from the remaining command line arguments.


That is, instead of running

java -Dfoo=bar -Dbaz=zoof MyClass MyArg1 MyArg2

you'd run

java MyWrapper -Dfoo=bar -Dbaz=zoof MyClass MyArg1 MyArg2

Although that's kind of hacky, it should work in the general case. Of course, if you have access to the source of MyClass, it'd be easier
to add support directly there to set system properties from -Dfoo=bar
style command-line arguments.


Still, this is unseemly enough that I'll look into adding proper support
for java properties in an upcoming condor developer series release.

-greg