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


Date: Wed, 02 Feb 2005 08:50:45 -0600
From: Michael Remijan <remijan@xxxxxxxxxxxxx>
Subject: Re: [Condor-users] JVM System Parameters!!
Greg,

Thanks for the advise. Actually an easier way is to use a file such as "jvm.properties" and then add that file to transfer_input_files of the submit files. I can then do something nice and simple like:

InputStream is = this.getClass().getResourceAsStream("/jvm.properties");
Properties props = System.getProperties();
props.load(is);

It's a little more elegant solution.


At 04:33 PM 2/1/2005, Greg Thain wrote:


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


_______________________________________________ Condor-users mailing list Condor-users@xxxxxxxxxxx http://lists.cs.wisc.edu/mailman/listinfo/condor-users


[← Prev in Thread] Current Thread [Next in Thread→]